Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install in virtualenv breaks virtualenv #2460

Closed
casey-boyer-bolt-data opened this issue Nov 11, 2019 · 2 comments
Closed

pip install in virtualenv breaks virtualenv #2460

casey-boyer-bolt-data opened this issue Nov 11, 2019 · 2 comments

Comments

@casey-boyer-bolt-data
Copy link

Upon installing the docker package in a virtualenv, the virtualenv becomes unusable (can no longer call pip or python).

Error:

(test-env) PS C:\Users\me\PyEnv\test-env> pip -V
Fatal Python error: initsite: Failed to import the site module
Traceback (most recent call last):
  File "c:\users\me\pyenv\test-env\lib\site.py", line 769, in <module>
    main()
  File "c:\users\me\pyenv\test-env\lib\site.py", line 746, in main
    paths_in_sys = addsitepackages(paths_in_sys)
  File "c:\users\me\pyenv\test-env\lib\site.py", line 279, in addsitepackages
    addsitedir(sitedir, known_paths)
  File "c:\users\me\pyenv\test-env\lib\site.py", line 202, in addsitedir
    addpackage(sitedir, name, known_paths)
  File "c:\users\me\pyenv\test-env\lib\site.py", line 170, in addpackage
    exec(line)
  File "<string>", line 1, in <module>
  File "c:\users\me\pyenv\test-env\lib\site-packages\win32\lib\pywin32_bootstrap.py", line 14, in <module>
    for maybe in site.getsitepackages():
AttributeError: module 'site' has no attribute 'getsitepackages'

Windows 10 Pro
Python Version 3.7.5, pip version 19.3.1 (installed for user only)

Steps to reproduce:

PS C:\Users\me\AppData\Local\Programs\Python\Python37> .\Scripts\virtualenv.exe C:\Users\me\PyEnv\test-env
PS C:\Users\me\AppData\Local\Programs\Python\Python37> cd C:\Users\me\PyEnv\test-env\
PS C:\Users\me\PyEnv\test-env> .\Scripts\activate
(test-env) PS C:\Users\me\PyEnv\test-env> pip install docker
...
Installing collected packages: six, pywin32, pypiwin32, chardet, idna, urllib3, certifi, requests, websocket-client, docker
Successfully installed certifi-2019.9.11 chardet-3.0.4 docker-4.1.0 idna-2.8 pypiwin32-223 pywin32-226 requests-2.22.0 six-1.13.0 urllib3-1.25.6 websocket-client-0.56.0
(test-env) PS C:\Users\me\PyEnv\test-env> pip -V
... ERROR ...
@DrFenerbache
Copy link

Was also getting this, looks like it's caused by the latest release of pywin32

mhammond/pywin32#1439

Going back to 225 works for me

@casey-boyer-bolt-data
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants