在Ubuntu 18.04、Python 3.6.7 64位、Mono 5.16上安装pythonnet失败

2024-04-05

我想在 Ubuntu 上安装 pythonnet,但失败了。

这就是我到目前为止所尝试的:

/usr/bin/python3 -m pip install -U pythonnet --user

Error:

Collection pythonnet
  Using cached https://files.pythonhosted.org/packages/89/3b/a22cd45b591d6cf490ee8b24d52b9db1f30b4b478b64a9b231c53474731e/pythonnet-2.3.0.tar.gz
Building wheels for collected packages: pythonnet
  Running setup.py bdist_wheel for pythonnet ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-sv3ax85u/pythonnet/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 /tmp/tmp36arfp8upip-wheel- --python-tag cp36:
  running bdist_wheel
  running build
  running build_ext
  Checking for updates from https://www.nuget.org/api/v2/.
  Currently running NuGet.exe 3.5.0.
  Updating NuGet.exe to 4.9.3.
  Update successful.
  MSBuild auto-detection: using msbuild version '15.0' from '/usr/lib/mono/msbuild/15.0/bin'.
  Restoring NuGet package NUnit.3.6.0.
    GET https://api.nuget.org/v3-flatcontainer/nunit/3.6.0/nunit.3.6.0.nupkg
    OK https://api.nuget.org/v3-flatcontainer/nunit/3.6.0/nunit.3.6.0.nupkg 511ms
  Installing NUnit 3.6.0.
  WARNING: Error downloading 'NUnit.3.6.0' from 'https://api.nuget.org/v3-flatcontainer/nunit/3.6.0/nunit.3.6.0.nupkg'.
  Access to the path "/home/localadmin/.nuget/packages/nunit/3.6.0" is denied.
    GET https://api.nuget.org/v3-flatcontainer/nunit/3.6.0/nunit.3.6.0.nupkg
    OK https://api.nuget.org/v3-flatcontainer/nunit/3.6.0/nunit.3.6.0.nupkg 131ms
  Installing NUnit 3.6.0.
  WARNING: Error downloading 'NUnit.3.6.0' from 'https://api.nuget.org/v3-flatcontainer/nunit/3.6.0/nunit.3.6.0.nupkg'.
  Access to the path "/home/localadmin/.nuget/packages/nunit/3.6.0" is denied.
    GET https://api.nuget.org/v3-flatcontainer/nunit/3.6.0/nunit.3.6.0.nupkg
    OK https://api.nuget.org/v3-flatcontainer/nunit/3.6.0/nunit.3.6.0.nupkg 88ms
  Installing NUnit 3.6.0.
  WARNING: Unable to find version '3.6.0' of package 'NUnit'.
    /home/localadmin/.nuget/packages/: Package 'NUnit.3.6.0' is not found on source '/home/localadmin/.nuget/packages/'.
    https://api.nuget.org/v3/index.json: Error downloading 'NUnit.3.6.0' from 'https://api.nuget.org/v3-flatcontainer/nunit/3.6.0/nunit.3.6.0.nupkg'.
    Access to the path "/home/localadmin/.nuget/packages/nunit/3.6.0" is denied.

  Restoring NuGet package NUnit.ConsoleRunner.3.6.0.
    GET https://api.nuget.org/v3-flatcontainer/nunit.consolerunner/3.6.0/nunit.consolerunner.3.6.0.nupkg
    OK https://api.nuget.org/v3-flatcontainer/nunit.consolerunner/3.6.0/nunit.consolerunner.3.6.0.nupkg 503ms
  Installing NUnit.ConsoleRunner 3.6.0.
  WARNING: Error downloading 'NUnit.ConsoleRunner.3.6.0' from 'https://api.nuget.org/v3-flatcontainer/nunit.consolerunner/3.6.0/nunit.consolerunner.3.6.0.nupkg'.
  Access to the path "/home/localadmin/.nuget/packages/nunit.consolerunner/3.6.0" is denied.
    GET https://api.nuget.org/v3-flatcontainer/nunit.consolerunner/3.6.0/nunit.consolerunner.3.6.0.nupkg
    OK https://api.nuget.org/v3-flatcontainer/nunit.consolerunner/3.6.0/nunit.consolerunner.3.6.0.nupkg 1098ms
  Installing NUnit.ConsoleRunner 3.6.0.
  WARNING: Error downloading 'NUnit.ConsoleRunner.3.6.0' from 'https://api.nuget.org/v3-flatcontainer/nunit.consolerunner/3.6.0/nunit.consolerunner.3.6.0.nupkg'.
  Access to the path "/home/localadmin/.nuget/packages/nunit.consolerunner/3.6.0" is denied.
    GET https://api.nuget.org/v3-flatcontainer/nunit.consolerunner/3.6.0/nunit.consolerunner.3.6.0.nupkg
    OK https://api.nuget.org/v3-flatcontainer/nunit.consolerunner/3.6.0/nunit.consolerunner.3.6.0.nupkg 103ms
  Installing NUnit.ConsoleRunner 3.6.0.
  WARNING: Unable to find version '3.6.0' of package 'NUnit.ConsoleRunner'.
    /home/localadmin/.nuget/packages/: Package 'NUnit.ConsoleRunner.3.6.0' is not found on source '/home/localadmin/.nuget/packages/'.
    https://api.nuget.org/v3/index.json: Error downloading 'NUnit.ConsoleRunner.3.6.0' from 'https://api.nuget.org/v3-flatcontainer/nunit.consolerunner/3.6.0/nunit.consolerunner.3.6.0.nupkg'.
    Access to the path "/home/localadmin/.nuget/packages/nunit.consolerunner/3.6.0" is denied.

  Restoring NuGet package UnmanagedExports.1.2.7.
  WARNING: Unable to obtain lock file access on '/tmp/NuGetScratch/lock/db443dd345f7ac17ac9828f7824a62300ac88e2c' for operations on 'packages/UnmanagedExports.1.2.7'. This may mean that a different user or administator is holding this lock and that this process does not have permission to access it. If no other process is currently performing an operation on this file it may mean that an earlier NuGet process crashed and left an inaccessible lock file, in this case removing the file '/tmp/NuGetScratch/lock/db443dd345f7ac17ac9828f7824a62300ac88e2c' will allow NuGet to continue.
  WARNING: Error downloading 'NUnit.3.6.0' from 'https://api.nuget.org/v3-flatcontainer/nunit/3.6.0/nunit.3.6.0.nupkg'.
  Access to the path "/home/localadmin/.nuget/packages/nunit/3.6.0" is denied.
  WARNING: Error downloading 'NUnit.3.6.0' from 'https://api.nuget.org/v3-flatcontainer/nunit/3.6.0/nunit.3.6.0.nupkg'.
  Access to the path "/home/localadmin/.nuget/packages/nunit/3.6.0" is denied.
  WARNING: Unable to find version '3.6.0' of package 'NUnit'.
    /home/localadmin/.nuget/packages/: Package 'NUnit.3.6.0' is not found on source '/home/localadmin/.nuget/packages/'.
    https://api.nuget.org/v3/index.json: Error downloading 'NUnit.3.6.0' from 'https://api.nuget.org/v3-flatcontainer/nunit/3.6.0/nunit.3.6.0.nupkg'.
    Access to the path "/home/localadmin/.nuget/packages/nunit/3.6.0" is denied.

  WARNING: Error downloading 'NUnit.ConsoleRunner.3.6.0' from 'https://api.nuget.org/v3-flatcontainer/nunit.consolerunner/3.6.0/nunit.consolerunner.3.6.0.nupkg'.
  Access to the path "/home/localadmin/.nuget/packages/nunit.consolerunner/3.6.0" is denied.
  WARNING: Error downloading 'NUnit.ConsoleRunner.3.6.0' from 'https://api.nuget.org/v3-flatcontainer/nunit.consolerunner/3.6.0/nunit.consolerunner.3.6.0.nupkg'.
  Access to the path "/home/localadmin/.nuget/packages/nunit.consolerunner/3.6.0" is denied.
  WARNING: Unable to find version '3.6.0' of package 'NUnit.ConsoleRunner'.
    /home/localadmin/.nuget/packages/: Package 'NUnit.ConsoleRunner.3.6.0' is not found on source '/home/localadmin/.nuget/packages/'.
    https://api.nuget.org/v3/index.json: Error downloading 'NUnit.ConsoleRunner.3.6.0' from 'https://api.nuget.org/v3-flatcontainer/nunit.consolerunner/3.6.0/nunit.consolerunner.3.6.0.nupkg'.
    Access to the path "/home/localadmin/.nuget/packages/nunit.consolerunner/3.6.0" is denied.

  WARNING: Unable to obtain lock file access on '/tmp/NuGetScratch/lock/db443dd345f7ac17ac9828f7824a62300ac88e2c' for operations on 'packages/UnmanagedExports.1.2.7'. This may mean that a different user or administator is holding this lock and that this process does not have permission to access it. If no other process is currently performing an operation on this file it may mean that an earlier NuGet process crashed and left an inaccessible lock file, in this case removing the file '/tmp/NuGetScratch/lock/db443dd345f7ac17ac9828f7824a62300ac88e2c' will allow NuGet to continue.

  Errors in packages.config projects
      Unable to find version '3.6.0' of package 'NUnit'.
        /home/localadmin/.nuget/packages/: Package 'NUnit.3.6.0' is not found on source '/home/localadmin/.nuget/packages/'.
        https://api.nuget.org/v3/index.json: Error downloading 'NUnit.3.6.0' from 'https://api.nuget.org/v3-flatcontainer/nunit/3.6.0/nunit.3.6.0.nupkg'.
        Access to the path "/home/localadmin/.nuget/packages/nunit/3.6.0" is denied.
      Unable to find version '3.6.0' of package 'NUnit.ConsoleRunner'.
        /home/localadmin/.nuget/packages/: Package 'NUnit.ConsoleRunner.3.6.0' is not found on source '/home/localadmin/.nuget/packages/'.
        https://api.nuget.org/v3/index.json: Error downloading 'NUnit.ConsoleRunner.3.6.0' from 'https://api.nuget.org/v3-flatcontainer/nunit.consolerunner/3.6.0/nunit.consolerunner.3.6.0.nupkg'.
        Access to the path "/home/localadmin/.nuget/packages/nunit.consolerunner/3.6.0" is denied.
      Unable to obtain lock file access on '/tmp/NuGetScratch/lock/db443dd345f7ac17ac9828f7824a62300ac88e2c' for operations on 'packages/UnmanagedExports.1.2.7'. This may mean that a different user or administator is holding this lock and that this process does not have permission to access it. If no other process is currently performing an operation on this file it may mean that an earlier NuGet process crashed and left an inaccessible lock file, in this case removing the file '/tmp/NuGetScratch/lock/db443dd345f7ac17ac9828f7824a62300ac88e2c' will allow NuGet to continue.

  NuGet Config files used:
      /home/localadmin/.config/NuGet/NuGet.Config

  Feeds used:
      /home/localadmin/.nuget/packages/
      https://api.nuget.org/v3/index.json
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-sv3ax85u/pythonnet/setup.py", line 405, in <module>
      zip_safe=False,
    File "/home/localadmin/.local/lib/python3.6/site-packages/setuptools/__init__.py", line 145, in setup
      return distutils.core.setup(**attrs)
    File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.6/dist-packages/wheel/bdist_wheel.py", line 192, in run
      self.run_command('build')
    File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/usr/lib/python3.6/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/usr/lib/python3.6/distutils/command/build_ext.py", line 339, in run
      self.build_extensions()
    File "/usr/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
      self._build_extensions_serial()
    File "/usr/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
      self.build_extension(ext)
    File "/tmp/pip-build-sv3ax85u/pythonnet/setup.py", line 139, in build_extension
      self._install_packages()
    File "/tmp/pip-build-sv3ax85u/pythonnet/setup.py", line 273, in _install_packages
      subprocess.check_call(cmd, shell=use_shell)
    File "/usr/lib/python3.6/subprocess.py", line 291, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command 'mono tools/nuget/nuget.exe restore pythonnet.sln -o packages' returned non-zero exit status 1.

  ----------------------------------------
  Failed building wheel for pythonnet

我也看了一眼https://github.com/pythonnet/pythonnet/wiki/Installation https://github.com/pythonnet/pythonnet/wiki/Installation但这没有帮助。

所以这也失败了:

/usr/bin/python3 -m pip install git+https://github.com/pythonnet/pythonnet --user

我也尝试过有和没有--egg option.

顺便说一句,我在代理服务器后面。所以我也尝试为NuGet设置代理服务器,请参阅代理背后的 NuGet https://stackoverflow.com/questions/9232160/nuget-behind-proxy:

mono /usr/lib/nuget/nuget.exe config -set http_proxy=http://my.proxy.address:port

知道我做错了什么吗?


我可以使用以下命令安装它:

sudo apt update
sudo apt-get install clang
sudo apt-get install libglib2.0-dev
sudo apt install git
sudo apt install nuget
git config --global http.proxy http://my.proxy.address:port
mono /usr/lib/nuget/nuget.exe config -set http_proxy=http://my.proxy.address:port
/usr/bin/python3 -m pip install -U pycparser --user
/usr/bin/python3 -m pip install -U git+https://github.com/pythonnet/pythonnet --user --egg

Update

using Pythonnet 2.5.1 https://pypi.org/project/pythonnet/2.5.1/:

sudo apt update
sudo apt-get install clang
sudo apt install nuget
git config --global http.proxy http://my.proxy.address:port
/usr/bin/python3 -m pip install -U pycparser --user
/usr/bin/python3 -m pip install -U pythonnet --user
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

在Ubuntu 18.04、Python 3.6.7 64位、Mono 5.16上安装pythonnet失败 的相关文章

随机推荐

  • C#:如何截取屏幕的一部分

    like TakeScreenshot new Rectangle 0 0 100 100 output jpg 使用以下内容 Rectangle rect new Rectangle 0 0 100 100 Bitmap bmp new
  • ObjectOutputStream 和 java.io.StreamCorruptedException

    当我尝试使用 ObjectOutputStream 将自定义对象 请参阅 Content java 从客户端发送到服务器时 在发送第一个对象后收到 StreamCorruptedException 因此 如果我尝试发送另一个对象 我会收到异
  • STL容器的范围插入函数在c ++ 11下返回void?

    刚刚学习c 所以我可能没有正确理解这一点 但我只读到范围插入函数在新标准下返回一个迭代器 C Primer 5th Ed cplusplus com http www cplusplus com reference string basic
  • Thymeleaf - 如何在 Thymeleaf 标签“th:if”中将字符串与 html 中的请求参数进行比较?

    如何将 Thymeleaf 标签 th if 中的字符串与 html 中的请求参数进行比较 现在我正在使用这个 div class error p class errorMsg span span p div 但不幸的是 它不起作用 它不起
  • Knockout js 大量自定义绑定

    在绑定不存在的情况下 处理大量自定义绑定的好方法是什么 假设我的 html 表达式绑定到 image url 如下所示 span title Company Logo span 然而 image url 绑定很可能不可用 在这种情况下 我只
  • 如何获取所有子文件夹及其文件 - UWP

    我在桌面上有一个名为student names 的固定文件夹 它包含子文件夹 每个子文件夹都包含其文件 现在我想将这些子文件夹及其相应的文件名存储在数组列表中 这怎么可能 UWP 应用程序不能directly访问文件夹 应用程序文件夹除外
  • Locust 95 百分位数高于最大值

    有时 当我在某些场景下运行 Locust 时 95 百分位数值会超过最大值 据我了解 95 意味着 95 的请求花费的时间比这个少 那么最大值怎么会小于 95 呢 我在这里做错了什么 我还发现只有当请求数量非常少 例如 15 个或更少 时才
  • 使用 CakePHP 2 的特征和命名空间的正确方法是什么?

    我正在使用 CakePHP 2 4 5 和 PHP 5 5 并且想使用一个特征 我在 Utility VariablesTrait php 中有一个称为VariablesTrait 为了利用命名空间 我给了它一个命名空间App Utilit
  • Json序列化Swift 3类型错误

    我使用以下代码从推送通知接收自定义数据 但收到以下错误 无法将类型 NSArrayM 0x1b0776cf0 的值转换为 NSDictionary 0x1b0777128 在下面一行 let jsonData try JSONSeriali
  • 网页查看历史记录

    WebView中什么时候将页面添加到前进后退列表中 我有 webview setMaintainsBackForwardList YES 但是 webview canGoBack 在我执行了几个 webview mainFrame load
  • Gtk Widget 到 Winform

    是否可以使用 System Windows Forms 将 Gtk 小部件嵌入到应用程序中 谢谢 两个工具包都使用自己单独的 UI Mainloop 来处理事件 例如鼠标移动 按钮按下等 因此 将两者混合实际上是不可能的 尽管几年前 Gtk
  • 使用多个参数记录

    我目前正在开发一个程序 其中我必须将所有输出写入日志文件 我需要编写一个日志方法 它应该按照我指定的顺序给出一个输出 其中包含级别 消息 对象值 另一条消息 一个整数值 另一条消息和另一个整数值 我似乎找不到执行此操作的日志方法 我在用Ja
  • 如何升级SQLite版本?

    我正在开发我的第一个应用程序 并使用以下代码查看我的 SQLite 版本 Cursor cursor SQLiteDatabase openOrCreateDatabase memory null rawQuery select sqlit
  • 如何设置 Eclipse 项目引用

    我的工作区中有一个 Web 项目 它依赖于工作区中的 java 项目 在项目引用中 我使我的 Web 项目引用了 java 项目 但仍然存在构建错误 表明我的 java 项目中的类未被我的 Web 项目引用 一个答案 这不是对您的问题的直接
  • Eclipse 找不到 MinGW。为什么?

    我都正确安装了 但是无论我是否正确设置编译器路径都没关系 因为它找不到 gcc 和 g 我用资源管理器检查过 它们位于正确的位置 我尽了一切努力 甚至以向后兼容模式并以管理员身份运行 Eclipse 编辑 如果 Eclipse 不能至少像用
  • 如何从 Javascript 或 Jquery 数组中选择随机值? [复制]

    这个问题在这里已经有答案了 我试图显示数组中的 3 个随机值 以下脚本仅从 javaScript 数组返回单个项目 var arrayNum One two three four five six seven eight nine var
  • 如何使用SessionState获取剩余会话超时时间?

    是否可以使用 ASP net 中的 sessionState 获取剩余会话超时 这是我的 webconfig 文件中的 sessionState 代码
  • 如何输出未包含在分组依据中的属性及其计数

    我在这里想要实现的是 我希望从该 LINQ 查询返回具有两个属性的列表 billNo 和同一 fromDate 上导入代码出现的次数 因此 这里我们的 billNo 1 和 2 都具有相同的导入代码 该导入代码在同一日期 01 01 202
  • 如何在 macOS 上将 libxml2 与 python 一起使用?

    我在 OSX Lion 上 安装了 libxml2 默认情况下 并且安装了 python 默认情况下 但它们不互相通信 在 Lion 上实现此功能的最简单方法是什么 python c import libxml2 Traceback mos
  • 在Ubuntu 18.04、Python 3.6.7 64位、Mono 5.16上安装pythonnet失败

    我想在 Ubuntu 上安装 pythonnet 但失败了 这就是我到目前为止所尝试的 usr bin python3 m pip install U pythonnet user Error Collection pythonnet Us