python使用virtualenvwrapper出现的问题
#pip install virtualenv virtualenwrapper
没有问题,但是创建虚拟环境时出错
#mkvirtualenv -p python3 scrapy
错误如下:
Installing setuptools, pkg_resources, pip, wheel...
Complete output from command /home/ptxc/下载/scrapy/bin/python3 - setuptools pkg_resources pip wheel:
Traceback (most recent call last):
File "<stdin>", line 7, in <module>
File "<frozen zipimport>", line 259, in load_module
File "/usr/share/python-wheels/pip-8.1.1-py2.py3-none-any.whl/pip/__init__.py", line 16, in <module>
File "<frozen zipimport>", line 259, in load_module
File "/usr/share/python-wheels/pip-8.1.1-py2.py3-none-any.whl/pip/vcs/subversion.py", line 9, in <module>
File "<frozen zipimport>", line 259, in load_module
File "/usr/share/python-wheels/pip-8.1.1-py2.py3-none-any.whl/pip/index.py", line 30, in <module>
File "<frozen zipimport>", line 259, in load_module
File "/usr/share/python-wheels/pip-8.1.1-py2.py3-none-any.whl/pip/wheel.py", line 32, in <module>
File "<frozen zipimport>", line 259, in load_module
File "/usr/share/python-wheels/pip-8.1.1-py2.py3-none-any.whl/pip/pep425tags.py", line 9, in <module>
File "/usr/local/lib/python3.9/ctypes/__init__.py", line 8, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
----------------------------------------
...Installing setuptools, pkg_resources, pip, wheel...done.
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/virtualenv.py", line 2363, in <module>
main()
File "/usr/lib/python3/dist-packages/virtualenv.py", line 709, in main
create_environment(home_dir,
File "/usr/lib/python3/dist-packages/virtualenv.py", line 984, in create_environment
install_wheel(
File "/usr/lib/python3/dist-packages/virtualenv.py", line 918, in install_wheel
call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
File "/usr/lib/python3/dist-packages/virtualenv.py", line 810, in call_subprocess
raise OSError(
OSError: Command /home/ptxc/下载/scrapy/bin/python3 - setuptools pkg_resources pip wheel failed with error code 1