GVKun编程网logo

Python setup.py开发与安装(python setup安装教程)

28

在本文中,我们将详细介绍Pythonsetup.py开发与安装的各个方面,并为您提供关于pythonsetup安装教程的相关解答,同时,我们也将为您带来关于ERROR:Command"pythonse

在本文中,我们将详细介绍Python setup.py开发与安装的各个方面,并为您提供关于python setup安装教程的相关解答,同时,我们也将为您带来关于ERROR: Command "python setup.py egg_info" python-nss、python setup.py install 安装的包 卸载方法、Python setup.py 开发与安装、python setuptools 安装 mysql-python报错的有用知识。

本文目录一览:

Python setup.py开发与安装(python setup安装教程)

Python setup.py开发与安装(python setup安装教程)

setup.py两个选项develop,并install混淆了我。根据此站点,使用develop创建到site-packages目录的特殊链接。

人们建议我使用python setup.py install全新安装,并且python setup.py develop对安装文件进行任何更改之后。

任何人都可以阐明这些命令的用法吗?

答案1

小编典典

python setup.py install 用于安装(通常是第三方)你不会自行开发/修改/调试的软件包。

对于你自己的东西,你想先安装你的软件包,然后能够频繁编辑代码而不必每次都重新安装软件包-正是python setup.py develop这样:它会安装软件包(通常只是一个源文件夹)以某种方式,你可以在将代码安装到(虚拟)环境后方便地编辑代码,并使更改立即生效。

请注意,强烈建议使用pip install .(安装)和pip install -e .(开发人员安装)来安装软件包,因为setup.py直接调用将对许多依赖项(例如pull prereleases和不兼容的软件包版本)做错事,或者使软件包难以使用卸载pip。

ERROR: Command

ERROR: Command "python setup.py egg_info" python-nss

[root@localhost ~]# pip install python-nss

DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won''t be maintained after that date. A future version of pip will drop support for Python 2.7.
Looking in indexes: http://pypi.douban.com/simple
Collecting python-nss
  Downloading http://pypi.doubanio.com/packages/6b/29/629098e34951c358b1f04f13a70b3590eb0cf2df817d945bd05c4169d71b/python-nss-1.0.1.tar.bz2 (222kB)
     |████████████████████████████████| 225kB 31kB/s 
    ERROR: Complete output from command python setup.py egg_info:
    ERROR: Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-JGnrT5/python-nss/setup.py", line 409, in <module>
        sys.exit(main(sys.argv))
      File "/tmp/pip-install-JGnrT5/python-nss/setup.py", line 333, in main
        nss_include_dir  = find_include_dir([''nss3'', ''nss''],   [''nss.h'',  ''pk11pub.h''], include_roots=include_roots)
      File "/tmp/pip-install-JGnrT5/python-nss/setup.py", line 94, in find_include_dir
        raise ValueError("unable to locate include directory containing header files %s" % include_files)

    ValueError: unable to locate include directory containing header files [''nss.h'', ''pk11pub.h'']

ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-JGnrT5/python-nss/


查看错误日志缺少头文件

进入python-nss官网,写着To build python-nss you the C language header files and libraries for both NSPR and NSS will need to be installed. This is system and distribution specific, as such we cannot give you explicit instructions. On Linux typically these packages are called:

  • nss-devel
  • nspr-devel

yum install nss-devel -y

yum install nspr-devel -y

python setup.py install 安装的包 卸载方法

python setup.py install 安装的包 卸载方法

 

增加 –record 参数重新安装软件包,执行命令:

python ./setup.py install --record install.txt

 

删除安装文件,执行命令:

cat install.txt | xargs rm -rf



 

Python setup.py 开发与安装

Python setup.py 开发与安装

setup.py中有两个选项developinstall我感到困惑。根据这个站点,使用develop会创建一个指向站点包目录的特殊链接。

人们建议我在对安装文件进行任何更改后python setup.py install进行全新安装。python setup.py develop

任何人都可以阐明这些命令的用法吗?

python setuptools 安装 mysql-python报错

python setuptools 安装 mysql-python报错

[root@wjx-03 gwcore]# easy_install mysql-python
Searching for mysql-python
Reading https://pypi.python.org/simple/mysql-python/
Best match: MySQL-python 1.2.5
Downloading https://pypi.python.org/packages/source/M/MySQL-python/MySQL-python-1.2.5.zip#md5=654f75b302db6ed8dc5a898c625e030c
Processing MySQL-python-1.2.5.zip
Writing /tmp/easy_install-my3ww2/MySQL-python-1.2.5/setup.cfg
Running MySQL-python-1.2.5/setup.py -q bdist_egg --dist-dir /tmp/easy_install-my3ww2/MySQL-python-1.2.5/egg-dist-tmp-i5Jy79
Traceback (most recent call last):
  File "/usr/bin/easy_install", line 9, in <module>
    load_entry_point(''setuptools==5.4.1'', ''console_scripts'', ''easy_install'')()
  File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 2147, in main
  File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 2133, in with_ei_usage
  File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 2150, in <lambda>
  File "/usr/lib64/python2.6/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib64/python2.6/distutils/dist.py", line 975, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python2.6/distutils/dist.py", line 995, in run_command
    cmd_obj.run()
  File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 370, in run
  File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 613, in easy_install
  File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 643, in install_item
  File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 833, in install_eggs
  File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 1055, in build_and_install
  File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 1040, in run_setup
  File "build/bdist.linux-x86_64/egg/setuptools/sandbox.py", line 63, in run_setup
  File "build/bdist.linux-x86_64/egg/setuptools/sandbox.py", line 109, in run
  File "build/bdist.linux-x86_64/egg/setuptools/sandbox.py", line 62, in runner
  File "build/bdist.linux-x86_64/egg/setuptools/sandbox.py", line 37, in _execfile
  File "/tmp/easy_install-my3ww2/MySQL-python-1.2.5/setup.py", line 2
    
    ^
SyntaxError: invalid syntax



我们今天的关于Python setup.py开发与安装python setup安装教程的分享就到这里,谢谢您的阅读,如果想了解更多关于ERROR: Command "python setup.py egg_info" python-nss、python setup.py install 安装的包 卸载方法、Python setup.py 开发与安装、python setuptools 安装 mysql-python报错的相关信息,可以在本站进行搜索。

本文标签: