简体   繁体   English

如何在Unbuntu 16.04上安装python3.6(dev)而不与python3.5(dev)冲突

[英]How to install python3.6 (dev) on Unbuntu 16.04 without colliding with python3.5 (dev)

I have an app that must be run on python3.6 and I'd prefer to run it on a Unbuntu 16.04 OS. 我有一个必须在python3.6上运行的应用程序,我希望在Unbuntu 16.04 OS上运行它。 Problem is that eventually python3.6 ends up trolling through /usr/lib/python3 which is already polluted with python3.5 libraries. 问题在于,最终python3.6最终将浏览/usr/lib/python3 ,该目录已被python3.5库污染。

I've tried uninstalling python3.5 but packages like cython3 keep pulling it back in. I've looked at pyenv as well as update-alternatives , but I'm not convinced they sanitize the /usr/lib and /usr/include . 我尝试卸载python3.5但像cython3这样的软件包cython3其重新拉回。我查看了pyenv以及update-alternatives ,但我不相信它们会清理/usr/lib/usr/include I'm still seeing python3.6-dev and python3.5-dev conflicts. 我仍然看到python3.6-devpython3.5-dev冲突。

Specific repos I'm trying to work on: 我正在尝试的特定存储库:

@tripleee was right, virtualenv fixed the problem, but there were quite few bumps along the way. @tripleee是正确的, virtualenv解决了该问题,但是在此过程中碰到的麻烦很少。 Here's what I did: 这是我所做的:

  1. Uninstalled cython3: ( apt-get remove cython3 ) 卸载的cython3 :( apt-get remove cython3
  2. Installed Py3.6 and dev: ( apt-get install python3.6 python3.6-dev ) 安装了Py3.6和dev:( apt-get install python3.6 python3.6-dev
  3. Installed VirtualEnv: ( python3.6 -m pip install virtualenv ) 已安装的VirtualEnv:( python3.6 -m pip install virtualenv
  4. Launched VirtualEnv: ( source $HOME/python3.6/bin/activate ) 启动VirtualEnv:( source $HOME/python3.6/bin/activate
  5. Built and installed sip-4.19.13 and PyQt5_gpl-5.11.3 from source. 从源代码构建并安装了sip-4.19.13PyQt5_gpl-5.11.3
  6. Installed python-trezor and electrum from source. 已安装python-trezorelectrum的来源。
  7. Launched electrum from VirtualEnv 从VirtualEnv启动electrum

Most of my problems were related to python3-* distribution packages, and the fact that wheels for 32bit linux are getting more and more rare. 我的大部分问题都与python3- *发行套件有关,而32位linux的转轮越来越少的事实。 This is what predicated the need for me to build PyQt5 and sip . 这就是我需要构建PyQt5sip I had them in a distribution package, but those packages always landed into the 3.5 tree, since 3.6 isn't officially supported on Ubuntu 16.04 LTS yet. 我将它们放在分发包中,但是这些包总是落入3.5树中,因为Ubuntu 16.04 LTS尚未正式支持3.6。

I've included the ubuntu16-electrum-git-build.sh script if anyone is interested. 如果有人感兴趣,我会提供ubuntu16-electrum-git-build.sh脚本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM