在无法访问互联网的情况下安装 pythonnet

埃里克·M

我正在尝试在无法访问互联网的机器上安装 pythonnet。在连接的机器上,我从 Github 下载了 pythonnet-master.zip,从 pypi 下载了 pythonnet-2.4.0.tar.gz。

当我尝试时pip install pythonnet-2.4.0.tar.gz,出现错误The remote name could not be resolved: 'www.nuget.org.

然后我用来conda install nuget-3.2.0.10516-py34_0.tar.bz2照顾nuget。安装成功了,但是还是无法安装pythonnet。

我尝试使用 pythonnet-master.zipconda install也失败了。任何想法都会有所帮助。

这是完整的错误输出:

(raman_env) C:\Users\Administrator\Desktop\eric\software>pip install pythonnet-2
.4.0.tar.gz
Processing c:\users\administrator\desktop\eric\software\pythonnet-2.4.0.tar.gz
Building wheels for collected packages: pythonnet
  Building wheel for pythonnet (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\ProgramData\Anaconda3\envs\raman_env\python.exe' -u -c 'import s
ys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ADMINI~1\\AppData\\Local
\\Temp\\pip-req-build-8jks801m\\setup.py'"'"'; __file__='"'"'C:\\Users\\ADMINI~1
\\AppData\\Local\\Temp\\pip-req-build-8jks801m\\setup.py'"'"';f=getattr(tokenize
, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'
"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C
:\Users\ADMINI~1\AppData\Local\Temp\pip-wheel-vi5w5zft' --python-tag cp37
       cwd: C:\Users\ADMINI~1\AppData\Local\Temp\pip-req-build-8jks801m\
  Complete output (44 lines):
  running bdist_wheel
  running build
  running build_ext
  Checking for updates from https://www.nuget.org/api/v2/.
  The remote name could not be resolved: 'www.nuget.org'
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\ADMINI~1\AppData\Local\Temp\pip-req-build-8jks801m\setup.py",
 line 658, in <module>
      zip_safe=False,
    File "C:\ProgramData\Anaconda3\envs\raman_env\lib\site-packages\setuptools\_
_init__.py", line 145, in setup
      return distutils.core.setup(**attrs)
    File "C:\ProgramData\Anaconda3\envs\raman_env\lib\distutils\core.py", line 1
48, in setup
      dist.run_commands()
    File "C:\ProgramData\Anaconda3\envs\raman_env\lib\distutils\dist.py", line 9
66, in run_commands
      self.run_command(cmd)
    File "C:\ProgramData\Anaconda3\envs\raman_env\lib\distutils\dist.py", line 9
85, in run_command
      cmd_obj.run()
    File "C:\Users\ADMINI~1\AppData\Local\Temp\pip-req-build-8jks801m\setup.py",
 line 610, in run
      return bdist_wheel.bdist_wheel.run(self)
    File "C:\ProgramData\Anaconda3\envs\raman_env\lib\site-packages\wheel\bdist_
wheel.py", line 192, in run
      self.run_command('build')
    File "C:\ProgramData\Anaconda3\envs\raman_env\lib\distutils\cmd.py", line 31
3, in run_command
      self.distribution.run_command(command)
    File "C:\ProgramData\Anaconda3\envs\raman_env\lib\distutils\dist.py", line 9
85, in run_command
      cmd_obj.run()
    File "C:\ProgramData\Anaconda3\envs\raman_env\lib\distutils\command\build.py
", line 135, in run
      self.run_command(cmd_name)
    File "C:\ProgramData\Anaconda3\envs\raman_env\lib\distutils\cmd.py", line 31
3, in run_command
      self.distribution.run_command(command)
    File "C:\ProgramData\Anaconda3\envs\raman_env\lib\distutils\dist.py", line 9
85, in run_command
      cmd_obj.run()
    File "C:\ProgramData\Anaconda3\envs\raman_env\lib\distutils\command\build_ex
t.py", line 340, in run
      self.build_extensions()
    File "C:\ProgramData\Anaconda3\envs\raman_env\lib\distutils\command\build_ex
t.py", line 449, in build_extensions
      self._build_extensions_serial()
    File "C:\ProgramData\Anaconda3\envs\raman_env\lib\distutils\command\build_ex
t.py", line 474, in _build_extensions_serial
      self.build_extension(ext)
    File "C:\Users\ADMINI~1\AppData\Local\Temp\pip-req-build-8jks801m\setup.py",
 line 245, in build_extension
      self._install_packages()
    File "C:\Users\ADMINI~1\AppData\Local\Temp\pip-req-build-8jks801m\setup.py",
 line 424, in _install_packages
      subprocess.check_call(cmd, shell=use_shell)
    File "C:\ProgramData\Anaconda3\envs\raman_env\lib\subprocess.py", line 347,
in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command 'tools\nuget\nuget.exe update -self' re
turned non-zero exit status 1.
  ----------------------------------------
  ERROR: Failed building wheel for pythonnet
  Running setup.py clean for pythonnet
Failed to build pythonnet
Installing collected packages: pythonnet
  Running setup.py install for pythonnet ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\ProgramData\Anaconda3\envs\raman_env\python.exe' -u -c 'import
 sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ADMINI~1\\AppData\\Loc
al\\Temp\\pip-req-build-8jks801m\\setup.py'"'"'; __file__='"'"'C:\\Users\\ADMINI
~1\\AppData\\Local\\Temp\\pip-req-build-8jks801m\\setup.py'"'"';f=getattr(tokeni
ze, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\
n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --recor
d 'C:\Users\ADMINI~1\AppData\Local\Temp\pip-record-31isrm6o\install-record.txt'
--single-version-externally-managed --compile
         cwd: C:\Users\ADMINI~1\AppData\Local\Temp\pip-req-build-8jks801m\
    Complete output (6 lines):
    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: setup.py --help [cmd1 cmd2 ...]
       or: setup.py --help-commands
       or: setup.py cmd --help

    error: option --single-version-externally-managed not recognized
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\ProgramData\Anaconda3\envs\ra
man_env\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'
C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-req-build-8jks801m\\setup.py'"'"'
; __file__='"'"'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-req-build-8jks801
m\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read
().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__,
'"'"'exec'"'"'))' install --record 'C:\Users\ADMINI~1\AppData\Local\Temp\pip-rec
ord-31isrm6o\install-record.txt' --single-version-externally-managed --compile C
heck the logs for full command output.
飞行柜员

由于缺少互联网连接setup.pyofpythonnet正在尝试运行nugget.exe update --self,但在您的系统中失败。我可以想到两种可能的解决方案:

  1. 尝试下载正确的whl文件而不是源安装在 pypi 上,只有 cp37 及以下版本。如果你运行的是 pyhton 3.8,你可以在这里找到正确的轮文件

  2. 解压tar.gz压缩和注释行424: subprocess.check_call(cmd, shell=use_shell)然后运行python setup.py install这将防止安装程序在安装过程中尝试更新 nugget

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

pythonnet dll目录访问被拒绝

PythonNet FileNotFoundException:无法找到程序集

在没有互联网的情况下安装 awscli

突然无法访问互联网

BroadcastReceiver无法访问互联网

AVD无法访问互联网

pythonnet无法从vb .net dll调用方法-TypeError

在jupyter笔记本中无法识别pythonnet clr

pythonnet在.net示例中嵌入Python无法加载模块

推送被拒绝,无法编译Python应用,pythonnet:状态为“错误”

在无法访问互联网的服务器上安装Jupyter

14.04.1服务器安装,无法访问互联网

Ubuntu 16.04 主机下的 Windows 8 VMWare 来宾无法访问互联网

如何在没有互联网连接的情况下安装“Make”?

如何在没有互联网连接的情况下安装tensorflow?

在没有互联网的情况下使用conda安装python软件包

如何在没有网络或互联网的情况下安装点子

如何在没有互联网连接的情况下安装软件包

在没有互联网连接的情况下安装B43驱动程序

我可以在没有互联网的情况下安装Ubuntu 13.10吗?

如何在没有互联网的情况下安装angular-cli

在没有互联网连接的情况下安装yum软件包

如何在没有互联网连接的情况下安装pyinstaller?

如何在没有互联网连接的情况下进行最小化安装?

我可以在没有互联网的情况下安装Ubuntu 13.10吗?

我想在没有互联网的情况下安装Wine吗?

如何在没有互联网连接的情况下安装[gcc]?

如何在没有互联网连接的情况下重新安装dhcpcd

如何在没有互联网的情况下安装软件包