Closed amtoine closed 2 years ago
This seems like a broken virtualenv installation. How did you install it?
@amtoine Hi, I have also faced a similar issue. I don't think the issue is directly related to the virtualenv
package itself...in my case, I had an Anaconda installation, which somehow also had remnants of virtualenv v20.0.35
, in addition to the latest v20.16.3
. A side-effect of this was the presence of the file virtualenv-20.0.35.dist-info
in the python site-packages
directory, which was then causing the virtualenv
call to execute virtualenv/activation/xonsh/__init__.py
. This actually does not exist in v20.16.3
, but existed in v20.0.35
...no idea why or how this is being called, but I think it is related to a broken Anaconda installation.
In my case, the "fix" was quite simple: just remove the virtualenv-20.0.35.dist-info
from the python site-packages
directory, and then all works fine...
PS: I am running Python 3.7.4 on Linux (Ubuntu), so you may not have the same diagnosis or fix, but worth checking for any offending "dist-info" directories not belonging to the latest version of virtualenv
.
Hope this helps! Regards.
Closing per above.+
This seems like a broken virtualenv installation.
yep i agree :thinking:
How did you install it?
in a shell, i've got
$ whereis virtualenv virtualenv: /usr/bin/virtualenv /home/ants/.local/bin/virtualenv /usr/share/man/man1/virtualenv.1.gz
/usr/bin/virtualenv
has been installed withpacman
and comes from thepython-virtualenv
package on ArchLinux~/.local/bin/virtualenv
has been installed withpip install virtualenv
, which was at version20.11.0
at the time, and i bumped up the version to20.16.3.dev3+gb18f733
today withpip install git+https://github.com/pypa/virtualenv.git@main
None of them work :confused:
Closing per above.+
so i should
rm ~/.local/lib/python3.10/site-packages/virtualenv-20.16.3.dist-info
?
Use pipx to install virtualenv is the best path ahead instead of installing it into your user profile.
Use pipx to install virtualenv is the best path ahead instead of installing it into your user profile.
ooooh i did not know
pipx
!!
so i can run virtualenv
inside pipx
' virtual environments and that works fine :ok_hand: :open_mouth:
thanks @gaborbernat :yum:
Closing per above.+
so i should
rm ~/.local/lib/python3.10/site-packages/virtualenv-20.16.3.dist-info
?
Actually, no, remove any dist-info directories for an older release (if they exist). If you do not have these, then your issue/diagnosis is different to what I have...
This issue is actually caused by a bug in the xonsh
shell, which was fixed in https://github.com/xonsh/xonsh/pull/4903
This issue is actually caused by a bug in the
xonsh
shell, which was fixed in https://github.com/xonsh/xonsh/pull/4903nice to hear :relieved:
This seems like a broken virtualenv installation.
yep i agree 🤔
How did you install it?
in a shell, i've got
$ whereis virtualenv virtualenv: /usr/bin/virtualenv /home/ants/.local/bin/virtualenv /usr/share/man/man1/virtualenv.1.gz
/usr/bin/virtualenv
has been installed withpacman
and comes from thepython-virtualenv
package on ArchLinux~/.local/bin/virtualenv
has been installed withpip install virtualenv
, which was at version20.11.0
at the time, and i bumped up the version to20.16.3.dev3+gb18f733
today withpip install git+https://github.com/pypa/virtualenv.git@main
None of them work 😕
I guess mv virtualenv-xx.x.xx.dist-info/ backup_virtualenv-xx.x.xx.dist-info/
is an safe way to solve this problem. thanks for this problem and your answers, really useful
Issue
I was trying to create a new
python
virtual environment to install some isolated dependencies, but then i getwhich never happened before :thinking:
Environment
version:
OS:
host python where
virtualenv
is installed:Click to expand pip list
```bash $ pip list Package Version ----------------------------- --------------------- agate 1.6.3 agate-dbf 0.2.2 agate-excel 0.2.5 agate-sql 0.5.8 alabaster 0.7.12 anyio 3.6.1 apipkg 2.1.1 appdirs 1.4.4 arandr 0.1.10 argcomplete 2.0.0 argon2-cffi 21.3.0 argon2-cffi-bindings 21.2.0 asciidoc 10.2.0 asciinema 2.2.0 astroid 2.12.2 asttokens 2.0.5 async-generator 1.10 attrs 21.4.0 autopep8 1.6.0 awscli 1.25.17 Babel 2.10.3 backcall 0.2.0 beautifulsoup4 4.11.1 black 22.6.0 bleach 4.1.0 botocore 1.27.27 Brlapi 0.8.4 btrfsutil 5.18.1 build 0.8.0 CacheControl 0.12.6 cachetools 4.2.4 cachy 0.3.0 cairocffi 1.3.0 certifi 2022.6.15 cffi 1.15.1 chardet 4.0.0 cleo 0.8.1 click 8.1.3 clikit 0.6.2 cloudpickle 2.1.0 colorama 0.4.5 commonmark 0.9.1 contextlib2 21.6.0 crashtest 0.3.1 cryptography 37.0.4 csvkit 1.0.6 dbfread 2.0.7 dbus-next 0.2.3 debugpy 1.5.1 decorator 5.1.1 defusedxml 0.7.1 deprecation 2.1.0 dill 0.3.4 distlib 0.3.5 distro 1.7.0 dmenu-extended 0.1.0 dnspython 2.2.1 docopt 0.6.2 docutils 0.19 entrypoints 0.4 et-xmlfile 1.1.0 ewmh 0.1.6 executing 0.8.2 fastjsonschema 2.16.1 filelock 3.6.0 flake8 4.0.1 flake8-black 0.3.3 Flask 2.0.2 future 0.18.2 fuzzywuzzy 0.18.0 gcalcli 4.3.0 google-api-core 2.3.2 google-api-python-client 2.34.0 google-auth 2.3.3 google-auth-httplib2 0.1.0 googleapis-common-protos 1.54.0 greenlet 1.1.2 grip 4.5.2 guake 3.9.1.dev0 html5lib 1.1 httplib2 0.20.2 idna 3.3 imagesize 1.4.1 importlib-metadata 4.8.1 iniconfig 1.1.1 installer 0.5.1 ipdb 0.13.9 ipykernel 6.7.0 ipython 8.0.0 ipython-genutils 0.2.0 ipywidgets 7.6.5 isodate 0.6.1 isort 5.10.1 itsdangerous 2.0.1 iwlib 1.7.0 jaraco.context 4.1.1 jaraco.functools 3.5.1 jaraco.text 3.8.1 jedi 0.18.1 jeepney 0.7.1 Jinja2 3.1.2 jmespath 1.0.0 json5 0.9.8 jsonschema 4.3.3 jupyter-client 7.1.2 jupyter-console 6.4.3 jupyter-core 4.9.2 jupyter-packaging 0.12.2 jupyter-server 1.18.1 jupyterlab 3.4.4 jupyterlab-pygments 0.1.2 jupyterlab-server 2.15.0 jupyterlab-widgets 1.0.2 keyring 23.4.0 keyutils 0.6 lark-parser 0.12.0 lazy-object-proxy 1.7.1 leather 0.3.4 lensfun 0.3.3 libfdt 1.6.1 lit 14.0.6.dev0 lockfile 0.12.2 louis 3.22.0 Markdown 3.4.1 MarkupSafe 2.1.1 matplotlib-inline 0.1.3 mccabe 0.7.0 meson 0.63.0 mistune 0.8.4 more-itertools 8.13.0 mpi4py 3.1.3 msgpack 1.0.3 mypy-extensions 0.4.3 nbclient 0.5.10 nbconvert 6.4.0 nbformat 5.1.3 nest-asyncio 1.5.4 netsnmp-python 1.0a1 nose 1.3.7 notebook 6.4.12 notebook-shim 0.1.0 nspektr 0.4.0 numpy 1.23.1 oauth2client 4.1.3 olefile 0.46 openpyxl 3.0.10 ordered-set 4.0.2 packaging 21.3 pandocfilters 1.5.0 parsedatetime 2.6 parso 0.8.3 pass-import 3.2 pastel 0.2.1 path-and-address 2.0.1 pathspec 0.9.0 pbr 5.8.0 pep517 0.12.0 pexpect 4.8.0 pickleshare 0.7.5 Pillow 9.2.0 pip 22.2.1 pipenv 2022.7.4 pkgconfig 1.5.5 pkginfo 1.8.3 platformdirs 2.5.1 pluggy 1.0.0 ply 3.11 poetry 1.1.14 poetry-core 1.0.8 progress 1.6 prometheus-client 0.12.0 prompt-toolkit 3.0.24 protobuf 3.19.1 psutil 5.9.0 ptipython 1.0.1 ptpython 3.0.20 ptyprocess 0.7.0 pulsemixer 1.5.1 pure-eval 0.2.1 py 1.11.0 pyaml 21.10.1 pyasn1 0.4.8 pyasn1-modules 0.2.8 pycairo 1.21.0 pycodestyle 2.8.0 pycparser 2.21 pyfiglet 0.8.post1 pyflakes 2.4.0 Pygments 2.12.0 PyGObject 3.42.2 PyICU 2.9 pylev 1.4.0 pylint 2.14.5 pynvim 0.4.3 PyOpenGL 3.1.6 pyOpenSSL 22.0.0 pyparsing 3.0.9 PyQt5 5.15.7 PyQt5-sip 12.11.0 PyQtWebEngine 5.15.6 pyrsistent 0.18.0 pyserial 3.5 PySide2 5.15.5 pyte 0.8.0 pytest 7.1.2 python-dateutil 2.8.2 python-distutils-extra 2.39 python-slugify 6.1.2 python-telegram 0.15.0 python-xlib 0.31 pytimeparse 1.1.8 pytz 2022.1 pyxdg 0.28 PyYAML 6.0 pyzmq 22.3.0 qtconsole 5.2.2 qtile 0.21.0 qtile-extras 0.1.dev140+g159eb19 QtPy 2.0.0 qutebrowser 2.5.2 ranger-fm 1.9.3 requests 2.27.1 requests-toolbelt 0.9.1 requests-unixsocket 0.3.0 resolvelib 0.8.1 retrying 1.3.3 rich 12.5.0 rsa 4.8 ruamel.yaml 0.16.13 s3transfer 0.6.0 screenkey 1.5 SecretStorage 3.3.2 Send2Trash 1.8.0 setproctitle 1.2.3 setuptools 61.3.1 shellingham 1.4.0 shiboken2 5.15.5 shtab 1.5.5 six 1.16.0 sniffio 1.2.0 snowballstemmer 2.2.0 soupsieve 2.3.2.post1 Sphinx 5.1.1 sphinx-rtd-theme 1.0.0 sphinxcontrib-applehelp 1.0.2 sphinxcontrib-devhelp 1.0.2 sphinxcontrib-htmlhelp 2.0.0 sphinxcontrib-jsmath 1.0.1 sphinxcontrib-qthelp 1.0.3 sphinxcontrib-serializinghtml 1.1.5 SQLAlchemy 1.4.39 stack-data 0.1.4 stevedore 3.5.0 TBB 0.2 team 1.0 tenacity 8.0.1 termcolor 1.1.0 termdown 1.18.0 terminado 0.12.1 testpath 0.5.0 text-unidecode 1.3 tg 0.19.0 tinycss2 1.1.1 tldr 3.1.0 toml 0.10.2 tomli 2.0.1 tomlkit 0.11.1 tornado 6.1 tqdm 4.64.0 traitlets 5.1.1 trove-classifiers 2022.7.22 typed-argument-parser 1.7.2 typing-extensions 3.10.0.2 typing-inspect 0.7.1 udiskie 2.4.2 ueberzug 18.1.9 ufw 0.36.1 uritemplate 4.1.1 urllib3 1.26.9 validate-pyproject 0.9 virtualenv 20.16.3.dev3+gb18f733 virtualenv-clone 0.5.7 virtualenvwrapper 4.8.4 virtualfish 2.5.4 wcwidth 0.2.5 webencodings 0.5.1 websocket-client 1.3.3 Werkzeug 2.0.2 wheel 0.37.1 widgetsnbextension 3.5.2 wrapt 1.14.1 xcffib 0.11.1 xlrd 2.0.1 xmltodict 0.13.0 xonsh 0.13.0 xontrib-fzf-widgets 0.0.4 xontrib-z 0.4 youtube-dl 2021.12.17 zipp 3.8.1 ```Output of the virtual environment creation