ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

python 手动装包报错:error: can't create or remove files in install directory

2021-12-02 16:31:06  阅读:238  来源: 互联网

标签:files python bdist redis 报错 build linux 64 egg


python 手动装包报错:error: can't create or remove files in install directory

没有权限,需要授权,或者使用 sudo 命令

这里需要注意的是,装好之后只能在包目录使用安装的包,,其他环境不行

[test@localhost redis-2.10.3]$ python setup.py install
running install
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 13] Permission denied: '/usr/lib/python2.7/site-packages/test-easy-install-84826.write-test'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /usr/lib/python2.7/site-packages/

Perhaps your account does not have write access to this directory?  If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account.  If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.

For information on other options, you may wish to consult the
documentation at:

  https://pythonhosted.org/setuptools/easy_install.html

Please make the appropriate changes for your system and try again.

[test@localhost redis-2.10.3]$ sudo python setup.py install
[sudo] test 的密码:
running install
running bdist_egg
running egg_info
writing redis.egg-info/PKG-INFO
writing top-level names to redis.egg-info/top_level.txt
writing dependency_links to redis.egg-info/dependency_links.txt
reading manifest file 'redis.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files found matching '__pycache__'
warning: no previously-included files matching '*.pyc' found under directory 'tests'
writing manifest file 'redis.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib
creating build/lib/redis
copying redis/__init__.py -> build/lib/redis
copying redis/_compat.py -> build/lib/redis
copying redis/client.py -> build/lib/redis
copying redis/connection.py -> build/lib/redis
copying redis/exceptions.py -> build/lib/redis
copying redis/lock.py -> build/lib/redis
copying redis/sentinel.py -> build/lib/redis
copying redis/utils.py -> build/lib/redis
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/redis
copying build/lib/redis/__init__.py -> build/bdist.linux-x86_64/egg/redis
copying build/lib/redis/_compat.py -> build/bdist.linux-x86_64/egg/redis
copying build/lib/redis/client.py -> build/bdist.linux-x86_64/egg/redis
copying build/lib/redis/connection.py -> build/bdist.linux-x86_64/egg/redis
copying build/lib/redis/exceptions.py -> build/bdist.linux-x86_64/egg/redis
copying build/lib/redis/lock.py -> build/bdist.linux-x86_64/egg/redis
copying build/lib/redis/sentinel.py -> build/bdist.linux-x86_64/egg/redis
copying build/lib/redis/utils.py -> build/bdist.linux-x86_64/egg/redis
byte-compiling build/bdist.linux-x86_64/egg/redis/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/redis/_compat.py to _compat.pyc
byte-compiling build/bdist.linux-x86_64/egg/redis/client.py to client.pyc
byte-compiling build/bdist.linux-x86_64/egg/redis/connection.py to connection.pyc
byte-compiling build/bdist.linux-x86_64/egg/redis/exceptions.py to exceptions.pyc
byte-compiling build/bdist.linux-x86_64/egg/redis/lock.py to lock.pyc
byte-compiling build/bdist.linux-x86_64/egg/redis/sentinel.py to sentinel.pyc
byte-compiling build/bdist.linux-x86_64/egg/redis/utils.py to utils.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying redis.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying redis.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying redis.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying redis.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/redis-2.10.3-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing redis-2.10.3-py2.7.egg
Copying redis-2.10.3-py2.7.egg to /usr/lib/python2.7/site-packages
Adding redis 2.10.3 to easy-install.pth file

Installed /usr/lib/python2.7/site-packages/redis-2.10.3-py2.7.egg
Processing dependencies for redis==2.10.3
Finished processing dependencies for redis==2.10.3
[test@localhost redis-2.10.3]$

标签:files,python,bdist,redis,报错,build,linux,64,egg
来源: https://www.cnblogs.com/liruilong/p/15633872.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有