gpt4 book ai didi

python-2.7 - virtualenv 与此系统或可执行文件不兼容

转载 作者:行者123 更新时间:2023-12-04 21:42:59 34 4
gpt4 key购买 nike

我对 Linux (Ubuntu) 和安装 (Python) 软件包比较陌生。我在使用 mkvirtualenv 时遇到了问题,无法解决:

~$ mkvirtualenv mysite70
New python executable in mysite70/bin/python
Traceback (most recent call last):
File "/usr/lib/python2.7/site.py", line 562, in <module>
main()
File "/usr/lib/python2.7/site.py", line 544, in main
known_paths = addusersitepackages(known_paths)
File "/usr/lib/python2.7/site.py", line 271, in addusersitepackages
user_site = getusersitepackages()
File "/usr/lib/python2.7/site.py", line 246, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/lib/python2.7/site.py", line 236, in getuserbase
USER_BASE = get_config_var('userbase')
File "/usr/lib/python2.7/sysconfig.py", line 577, in get_config_var
return get_config_vars().get(name)
File "/usr/lib/python2.7/sysconfig.py", line 476, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/usr/lib/python2.7/sysconfig.py", line 355, in _init_posix
raise IOError(msg)
IOError: invalid Python installation: unable to open /home/sietse/.virtualenvs/mysite70/local/include/python2.7/pyconfig.h (No such file or directory)
ERROR: The executable mysite70/bin/python is not functioning
ERROR: It thinks sys.prefix is u'/home/usr/.virtualenvs' (should be u'/home/usr/.virtualenvs/mysite70')
ERROR: virtualenv is not compatible with this system or executable

我安装错了吗?

最佳答案

这可能是您当前在 Linux 计算机上登录的用户的权限错误。

尝试

sudo mkvirtualenv mysite70

这通常会提示输入 root 用户的密码。

如果这不起作用,您可能需要查看以下文章:

http://noelusion.com/2013/Fixing-the-mysterious-virtualenv-error-IOError-invalid-Python-installation/

但请注意,这篇文章是对一个相当具体的实例的黑客攻击。

关于python-2.7 - virtualenv 与此系统或可执行文件不兼容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21686626/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com