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
[Mac] Trying to create a python virtual environment but getting OSError #788
Comments
I have the exact same error, and I'm using a very similar set up:
|
This is a possible duplicate of #788 |
See conda/conda#1367 |
@grisaitis #788 is a duplicate of #788? :D And yes, at the moment this looks like a conda python issue. |
Oops! Sorry, I meant it could be a duplicate of this: #741 |
And this is "fixed" by downgrading to Python 2.7.9, in case you didn't see in conda/conda#1367 |
Actually, it is not fixed (and I am aware that this is probably a condo/virtualenv co-issue). I have the same problems with Python 2.7.11 and Python 3.5.1 and conda 3.18.9 (and pip 7.1.2). |
@jenisys please could you paste the actual error? |
With a conda environment based on python 2.7.11 and virtualenv 13.0.1, I get the similar error that was described above (but another CPython symbol is missing now); # -- CASE: Using conda environment "py27" with python 2.7.11
# INSTALLED: virtualenv 13.0.1, pip 7.1.2, wheel 0.26.0
$ virtualenv xxx
New python executable in xxx/bin/python
Installing setuptools, pip, wheel...
Complete output from command /Users/alice/tmp/venv/xxx/bin/python -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip wheel:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/alice/conda/envs/py27/lib/python2.7/site-packages/virtualenv_support/pip-7.0.1-py2.py3-none-any.whl/pip/__init__.py", line 13, in <module>
File "/Users/alice/conda/envs/py27/lib/python2.7/site-packages/virtualenv_support/pip-7.0.1-py2.py3-none-any.whl/pip/utils/__init__.py", line 15, in <module>
File "/Users/alice/conda/envs/py27/lib/python2.7/zipfile.py", line 6, in <module>
import io
File "/Users/alice/conda/envs/py27/lib/python2.7/io.py", line 51, in <module>
import _io
ImportError: dlopen(/Users/alice/tmp/venv/xxx/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyCodecInfo_GetIncrementalDecoder
Referenced from: /Users/alice/tmp/venv/xxx/lib/python2.7/lib-dynload/_io.so
Expected in: dynamic lookup
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
File "/Users/alice/conda/envs/py27/bin/virtualenv", line 6, in <module>
sys.exit(main())
File "/Users/alice/conda/envs/py27/lib/python2.7/site-packages/virtualenv.py", line 832, in main
symlink=options.symlink)
File "/Users/alice/conda/envs/py27/lib/python2.7/site-packages/virtualenv.py", line 1004, in create_environment
install_wheel(to_install, py_executable, search_dirs)
File "/Users/alice/conda/envs/py27/lib/python2.7/site-packages/virtualenv.py", line 969, in install_wheel
'PIP_NO_INDEX': '1'
File "/Users/alice/conda/envs/py27/lib/python2.7/site-packages/virtualenv.py", line 910, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /Users/alice/tmp/venv/xxx/bin/python -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip wheel failed with error code 1 With a conda environment with python 3.5.1, the error looks slightly different: # -- CASE: Using conda environment "py35" with python 3.5.1
# INSTALLED: virtualenv 13.1.2, pip 7.1.2, wheel 0.26.0
$ virtualenv --verbose xxx2
Using base prefix '/Users/alice/conda/envs/py35'
Creating xxx2/lib/python3.5
Symlinking Python bootstrap modules
Symlinking xxx2/lib/python3.5/config-3.5m
Symlinking xxx2/lib/python3.5/lib-dynload
Symlinking xxx2/lib/python3.5/plat-darwin
Symlinking xxx2/lib/python3.5/os.py
...
Symlinking xxx2/lib/python3.5/_bootlocale.py
Creating xxx2/lib/python3.5/site-packages
Writing xxx2/lib/python3.5/site.py
Writing xxx2/lib/python3.5/orig-prefix.txt
Writing xxx2/lib/python3.5/no-global-site-packages.txt
Creating parent directories for xxx2/include
Symlinking xxx2/include/python3.5m
Creating xxx2/bin
New python executable in xxx2/bin/python3
Changed mode of xxx2/bin/python3 to 0o755
Also creating executable in xxx2/bin/python
Changed mode of xxx2/bin/python to 0o755
Testing executable with xxx2/bin/python3 -c "import sys;out=sys.stdout;getattr(out, "buffer", out).write(sys.prefix.encode("utf-8"))"
ERROR: The executable xxx2/bin/python3 is not functioning
ERROR: It thinks sys.prefix is '/Users/alice/tmp/venv' (should be '/Users/alice/tmp/venv/xxx2')
ERROR: virtualenv is not compatible with this system or executable When I use |
I have the same issue here, can someone point me the solution for this issue? Since it's closed, must be solved right? |
@icrtiou It's closed here because it's a conda issue (the issue number is noted above). Doesn't look like it's fixed there yet, but you should review the conda ticket for further information. |
I've ran into a similar error (not using anaconda, installed python using brew install) when I was trying to recreate an env without first deleting the previous env. after rm -rf of the old env path, the error was solved... |
I had a similar issue with conda and virtualenv. I was able to successfully install and activate an env with the following command: |
Thank you!! That worked for me. |
my solution is change the default python and pip to /user/bin/python instead of conda version rm -rf .virtualenvs/ # remove |
The solution proposed by @RubenDuran worked for me. |
I wasn't using anaconda and was running into this. Just trying to use pyenv and virtualenvwrapper. I swear this had worked before but I was running this to create a new virtualenv:
That would yield a similar stack trace to those above. To fix it, I installed pyenv-virtualenvwrapper. Then the following is how I got it to work:
Not totally sure what happened but it's working and thought I'd share in case anyone else was running into a similar issue. |
@RubenDuran you are a superstar! You solution worked perfectly for me. |
@RubenDuran thanks a bunch! |
Again @RubenDuran solution worked! Thanks!!! |
Solution to create the virtual environment for your project if you have conda. I had a similar issue, I tried the following command and it worked for me.
yourenvname is the name of the virtual environment that you are going to create and use. |
Hi, yum install epel-releaseyum install python-pippip install -U pipyum -y install python-virtualenvyum -y install python-virtualenvwrapper$ export WORKON_HOME=~/.virtualenvs |
Mac OS X: 10.9.5
pip 7.1.2
virtualenv 13.1.2
Python: Python 2.7.10 :: Anaconda 2.3.0 (x86_64)
Shuais-MacBook-Pro:Google Drive shuaiwang$ virtualenv ENV
New python executable in ENV/bin/python
Installing setuptools, pip, wheel...
Complete output from command "/Users/shuaiwang/Google Drive/ENV/bin/python" -c "import sys, pip; sys...d"] + sys.argv[1:]))" setuptools pip wheel:
Traceback (most recent call last):
File "", line 1, in
File "/Users/shuaiwang/anaconda/lib/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/init.py", line 13, in
File "/Users/shuaiwang/anaconda/lib/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/utils/init.py", line 15, in
File "/Users/shuaiwang/anaconda/lib/python2.7/zipfile.py", line 6, in
import io
File "/Users/shuaiwang/anaconda/lib/python2.7/io.py", line 51, in
import _io
ImportError: dlopen(/Users/shuaiwang/Google Drive/ENV/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyErr_ReplaceException
Referenced from: /Users/shuaiwang/Google Drive/ENV/lib/python2.7/lib-dynload/_io.so
Expected in: dynamic lookup
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
File "/Users/shuaiwang/anaconda/bin/virtualenv", line 11, in
sys.exit(main())
File "/Users/shuaiwang/anaconda/lib/python2.7/site-packages/virtualenv.py", line 832, in main
symlink=options.symlink)
File "/Users/shuaiwang/anaconda/lib/python2.7/site-packages/virtualenv.py", line 1004, in create_environment
install_wheel(to_install, py_executable, search_dirs)
File "/Users/shuaiwang/anaconda/lib/python2.7/site-packages/virtualenv.py", line 969, in install_wheel
'PIP_NO_INDEX': '1'
File "/Users/shuaiwang/anaconda/lib/python2.7/site-packages/virtualenv.py", line 910, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command "/Users/shuaiwang/Google Drive/ENV/bin/python" -c "import sys, pip; sys...d"] + sys.argv[1:]))" setuptools pip wheel failed with error code 1
The text was updated successfully, but these errors were encountered: