我尝试uvloop
在 CentOS 7 上安装到 Python 3.9 venv。这些都是我采取的所有措施:
cd ~
mkdir python_envs
cd python_envs
python -m venv test
source test/bin/activate
pip install --upgrade pip
pip install uvloop
然后我得到这个:
Collecting uvloop
Using cached uvloop-0.14.0.tar.gz (2.0 MB)
Using legacy 'setup.py install' for uvloop, since package 'wheel' is not installed.
Installing collected packages: uvloop
Running setup.py install for uvloop ... error
ERROR: Command errored out with exit status 1:
command: /home/music/python_envs/test/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-85ij25up/uvloop_2c4ab2d368cc414bb626701bc788f90f/setup.py'"'"'; __file__='"'"'/tmp/pip-install-85ij25up/uvloop_2c4ab2d368cc414bb626701bc788f90f/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-l3ksyogz/install-record.txt --single-version-externally-managed --compile --install-headers /home/music/python_envs/test/include/site/python3.9/uvloop
cwd: /tmp/pip-install-85ij25up/uvloop_2c4ab2d368cc414bb626701bc788f90f/
Complete output (76 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.9
creating build/lib.linux-x86_64-3.9/uvloop
copying uvloop/_noop.py -> build/lib.linux-x86_64-3.9/uvloop
copying uvloop/_patch.py -> build/lib.linux-x86_64-3.9/uvloop
copying uvloop/__init__.py -> build/lib.linux-x86_64-3.9/uvloop
copying uvloop/_testbase.py -> build/lib.linux-x86_64-3.9/uvloop
running egg_info
writing uvloop.egg-info/PKG-INFO
writing dependency_links to uvloop.egg-info/dependency_links.txt
writing top-level names to uvloop.egg-info/top_level.txt
reading manifest file 'uvloop.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*' found under directory 'vendor/libuv/.git'
warning: no previously-included files matching '*' found under directory 'vendor/libuv/docs'
warning: no previously-included files matching '*' found under directory 'vendor/libuv/img'
writing manifest file 'uvloop.egg-info/SOURCES.txt'
copying uvloop/cbhandles.pxd -> build/lib.linux-x86_64-3.9/uvloop
copying uvloop/cbhandles.pyx -> build/lib.linux-x86_64-3.9/uvloop
copying uvloop/dns.pyx -> build/lib.linux-x86_64-3.9/uvloop
copying uvloop/errors.pyx -> build/lib.linux-x86_64-3.9/uvloop
copying uvloop/loop.c -> build/lib.linux-x86_64-3.9/uvloop
copying uvloop/loop.pxd -> build/lib.linux-x86_64-3.9/uvloop
copying uvloop/loop.pyx -> build/lib.linux-x86_64-3.9/uvloop
copying uvloop/lru.pyx -> build/lib.linux-x86_64-3.9/uvloop
copying uvloop/pseudosock.pyx -> build/lib.linux-x86_64-3.9/uvloop
copying uvloop/request.pxd -> build/lib.linux-x86_64-3.9/uvloop
copying uvloop/request.pyx -> build/lib.linux-x86_64-3.9/uvloop
copying uvloop/server.pxd -> build/lib.linux-x86_64-3.9/uvloop
copying uvloop/server.pyx -> build/lib.linux-x86_64-3.9/uvloop
copying uvloop/sslproto.pxd -> build/lib.linux-x86_64-3.9/uvloop
copying uvloop/sslproto.pyx -> build/lib.linux-x86_64-3.9/uvloop
creating build/lib.linux-x86_64-3.9/uvloop/handles
copying uvloop/handles/async_.pxd -> build/lib.linux-x86_64-3.9/uvloop/handles
copying uvloop/handles/async_.pyx -> build/lib.linux-x86_64-3.9/uvloop/handles
copying uvloop/handles/basetransport.pxd -> build/lib.linux-x86_64-3.9/uvloop/handles
copying uvloop/handles/basetransport.pyx -> build/lib.linux-x86_64-3.9/uvloop/handles
copying uvloop/handles/check.pxd -> build/lib.linux-x86_64-3.9/uvloop/handles
copying uvloop/handles/check.pyx -> build/lib.linux-x86_64-3.9/uvloop/handles
copying uvloop/handles/handle.pxd -> build/lib.linux-x86_64-3.9/uvloop/handles
copying uvloop/handles/handle.pyx -> build/lib.linux-x86_64-3.9/uvloop/handles
copying uvloop/handles/idle.pxd -> build/lib.linux-x86_64-3.9/uvloop/handles
copying uvloop/handles/idle.pyx -> build/lib.linux-x86_64-3.9/uvloop/handles
copying uvloop/handles/pipe.pxd -> build/lib.linux-x86_64-3.9/uvloop/handles
copying uvloop/handles/pipe.pyx -> build/lib.linux-x86_64-3.9/uvloop/handles
copying uvloop/handles/poll.pxd -> build/lib.linux-x86_64-3.9/uvloop/handles
copying uvloop/handles/poll.pyx -> build/lib.linux-x86_64-3.9/uvloop/handles
copying uvloop/handles/process.pxd -> build/lib.linux-x86_64-3.9/uvloop/handles
copying uvloop/handles/process.pyx -> build/lib.linux-x86_64-3.9/uvloop/handles
copying uvloop/handles/stream.pxd -> build/lib.linux-x86_64-3.9/uvloop/handles
copying uvloop/handles/stream.pyx -> build/lib.linux-x86_64-3.9/uvloop/handles
copying uvloop/handles/streamserver.pxd -> build/lib.linux-x86_64-3.9/uvloop/handles
copying uvloop/handles/streamserver.pyx -> build/lib.linux-x86_64-3.9/uvloop/handles
copying uvloop/handles/tcp.pxd -> build/lib.linux-x86_64-3.9/uvloop/handles
copying uvloop/handles/tcp.pyx -> build/lib.linux-x86_64-3.9/uvloop/handles
copying uvloop/handles/timer.pxd -> build/lib.linux-x86_64-3.9/uvloop/handles
copying uvloop/handles/timer.pyx -> build/lib.linux-x86_64-3.9/uvloop/handles
copying uvloop/handles/udp.pxd -> build/lib.linux-x86_64-3.9/uvloop/handles
copying uvloop/handles/udp.pyx -> build/lib.linux-x86_64-3.9/uvloop/handles
creating build/lib.linux-x86_64-3.9/uvloop/includes
copying uvloop/includes/__init__.py -> build/lib.linux-x86_64-3.9/uvloop/includes
copying uvloop/includes/compat.h -> build/lib.linux-x86_64-3.9/uvloop/includes
copying uvloop/includes/consts.pxi -> build/lib.linux-x86_64-3.9/uvloop/includes
copying uvloop/includes/debug.h -> build/lib.linux-x86_64-3.9/uvloop/includes
copying uvloop/includes/debug.pxd -> build/lib.linux-x86_64-3.9/uvloop/includes
copying uvloop/includes/flowcontrol.pxd -> build/lib.linux-x86_64-3.9/uvloop/includes
copying uvloop/includes/fork_handler.h -> build/lib.linux-x86_64-3.9/uvloop/includes
copying uvloop/includes/python.pxd -> build/lib.linux-x86_64-3.9/uvloop/includes
copying uvloop/includes/stdlib.pxi -> build/lib.linux-x86_64-3.9/uvloop/includes
copying uvloop/includes/system.pxd -> build/lib.linux-x86_64-3.9/uvloop/includes
copying uvloop/includes/uv.pxd -> build/lib.linux-x86_64-3.9/uvloop/includes
running build_ext
error: [Errno 13] Permission denied: './configure'
----------------------------------------
ERROR: Command errored out with exit status 1: /home/music/python_envs/test/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-85ij25up/uvloop_2c4ab2d368cc414bb626701bc788f90f/setup.py'"'"'; __file__='"'"'/tmp/pip-install-85ij25up/uvloop_2c4ab2d368cc414bb626701bc788f90f/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-l3ksyogz/install-record.txt --single-version-externally-managed --compile --install-headers /home/music/python_envs/test/include/site/python3.9/uvloop Check the logs for full command output.
我认为关键的错误信息是error: [Errno 13] Permission denied: './configure'
,但我不知道这发生在哪个目录。我已经阅读了此答案和一些相关信息,但似乎无法解决我的问题:
pip install failed with: OSError: [Errno 13] Permission denied on directory
install in env
:如您所见,我在全新的环境中执行此操作,但无法正常工作。pip install --user
: 不行,我明白了:
ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.
pip install --user
+ 修改环境include-system-site-packages = false
中true
的pyvenv.cfg
:可以开始安装,但是回到原来的权限被拒绝的问题。sudo
: 不安全,会引起其他问题。我将把它作为最后的解决方案。chmod -R 777 test
:这不是一个解决方案,只是一个测试,以确保问题不在 env 目录的权限上。同样的权限问题仍然存在。我知道有一些不同的安装方法可以避免这个权限问题,但我想知道原因,有没有办法在pip install -r requirement.txt
不处理这种特殊情况的情况下正常工作?
更新:
即使我这样做
sudo -s # become root
source test/bin/activate
pip install uvloop
仍然发生同样的问题error: [Errno 13] Permission denied: './configure'
。我不知道这怎么会发生。