Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
622 views
in Technique[技术] by (71.8m points)

python - Virtualenv OSError - setuptools pip wheel failed with error code 1

I get the following error message when trying to set up a virtual environment with virtualenv 15.0.2 but receive OSError setuptools pip wheel failed with error code 1.

New python executable in /Users/nathmorissette/projects/tutorial/venv/bin/python
Installing setuptools, pip, wheel...
  Complete output from command /Users/nathmorissett...rial/venv/bin/python - setuptools pip wheel:
  Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
  File "/Users/nathmorissette/miniconda2/lib/python2.7/tempfile.py", line 32, in <module>
    import io as _io
  File "/Users/nathmorissette/miniconda2/lib/python2.7/io.py", line 51, in <module>
    import _io
ImportError: dlopen(/Users/nathmorissette/projects/tutorial/venv/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyCodecInfo_GetIncrementalDecoder
  Referenced from: /Users/nathmorissette/projects/tutorial/venv/lib/python2.7/lib-dynload/_io.so
  Expected in: dynamic lookup

----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
  File "/Users/nathmorissette/miniconda2/bin/virtualenv", line 9, in <module>
    load_entry_point('virtualenv==15.0.2', 'console_scripts', 'virtualenv')()
  File "/Users/nathmorissette/miniconda2/lib/python2.7/site-packages/virtualenv-15.0.2-py2.7.egg/virtualenv.py", line 711, in main
    symlink=options.symlink)
  File "/Users/nathmorissette/miniconda2/lib/python2.7/site-packages/virtualenv-15.0.2-py2.7.egg/virtualenv.py", line 944, in create_environment
    download=download,
  File "/Users/nathmorissette/miniconda2/lib/python2.7/site-packages/virtualenv-15.0.2-py2.7.egg/virtualenv.py", line 900, in install_wheel
    call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
  File "/Users/nathmorissette/miniconda2/lib/python2.7/site-packages/virtualenv-15.0.2-py2.7.egg/virtualenv.py", line 795, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /Users/nathmorissett...rial/venv/bin/python - setuptools pip wheel failed with error code 1

Any ideas how to resolve this issue?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I tried for hours, read lots of posts and finally find a way out.

pip uninstall virtualenv conda install virtualenv

The reason is the virtualenv installed by pip is not compatible with conda. I don't know more details, but it works for me.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...