在这篇文章中,我们将带领您了解Ubuntu16.04上使用Anaconda3的Python3.6的pip安装UWSGI报错解决办法的全貌,包括ubuntu安装python3.6的pip的相关情况。同时
在这篇文章中,我们将带领您了解Ubuntu16.04上使用Anaconda3的Python3.6的pip安装UWSGI报错解决办法的全貌,包括ubuntu安装python3.6 的pip的相关情况。同时,我们还将为您介绍有关Pip已安装到python3.6,但是我在Ubuntu 18.04上将python3.7与VS Code一起使用、python – 通过pip安装uwsgi 1.2.5、Python-Anaconda Apache mod_wsgi Ubuntu、Ubuntu 16.04 安装 anaconda3的知识,以帮助您更好地理解这个主题。
本文目录一览:- Ubuntu16.04上使用Anaconda3的Python3.6的pip安装UWSGI报错解决办法(ubuntu安装python3.6 的pip)
- Pip已安装到python3.6,但是我在Ubuntu 18.04上将python3.7与VS Code一起使用
- python – 通过pip安装uwsgi 1.2.5
- Python-Anaconda Apache mod_wsgi Ubuntu
- Ubuntu 16.04 安装 anaconda3
Ubuntu16.04上使用Anaconda3的Python3.6的pip安装UWSGI报错解决办法(ubuntu安装python3.6 的pip)
具体报错信息:
lto1: fatal error: bytecode stream generated with LTO version 6.0 instead of the expected 4.1
compilation terminated.
lto-wrapper: fatal error: gcc returned 1 exit status
compilation terminated.
/home/liuzhen/anaconda3/compiler_compat/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
*** error linking uWSGI ***
解决办法:
原因是Ubuntu系统的gcc版本问题,我安装时本机的gcc版本是5.4,然后我把gcc版本修改成了4.7,重新使用pip install uwsgi,完美解决问题。
安装gcc4.7:sudo apt-get install gcc-4.7
修改系统默认的gcc版本:https://blog.csdn.net/jacke121/article/details/54565281
步骤:
sudo rm /usr/bin/gcc(删除已有软连接)
sudo ln -s /usr/bin/gcc-4.7 /usr/bin/gcc(创建指向gcc4.7的软连接,这样系统默认的gcc版本就是4.7了)
Pip已安装到python3.6,但是我在Ubuntu 18.04上将python3.7与VS Code一起使用
我是python和ubuntu的新手.我最近一直在关注一些教程,他们使用pylint来检查python代码的语法.
我已经使用“ sudo pip3 install pylint”通过终端正常安装了该文件,但是,每当我在VS Code中进行格式化时,都会出现错误消息,指出pylint不存在,我是否要安装.在尝试安装时,由于不存在pip,我收到另一个错误.
在尝试重新安装pip和pylint之后,我已经在终端中查看了,但是它将进入python3.6文件夹而不是python3.7文件夹,因此出现了错误.
有关如何解决此问题的任何想法?
点输出当前为:“来自/usr/lib / python3 / dist-packages(python 3.6)的点9.0.1”
如果我尝试使用“ python3 -m pip install pylint”通过终端安装pylint,则会出现输出错误:“ /usr/local/bin / python3:没有名为pip的模块”
我用谷歌搜索发现了这篇文章:http://ubuntuhandbook.org/index.php/2017/07/install-python-3-6-1-in-ubuntu-16-04-lts/
在第3步,它通过以下命令告诉您如何使python3使用新安装:
sudo update-alternatives –install /usr/local/bin / python3 python3 /usr/bin/python3.7 1
现在,当我安装pip和pylint时,它会定向到新的3.7文件夹.这意味着它也可以与VS Code一起使用.
python – 通过pip安装uwsgi 1.2.5
欢迎,
目前我正在尝试根据网站的指示在我的VPS(Ubuntu 11.10)上安装最新的uwsgi
http://projects.unbit.it/uwsgi/wiki/Quickstart
pip install uwsgi
在编译期间,我看到一些错误:
...
[gcc -pthread] spooler.o
*** uWsgi compiling embedded plugins ***
[gcc -pthread] plugins/python/python_plugin.o
Complete output from command /usr/bin/python -c "import setuptools;__file__='/etc/apt/sources.list.d/build/uwsgi/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-joud1I-record/install-record.txt:
running install
In file included from plugins/python/python_plugin.c:1:0:
plugins/python/uwsgi_python.h:2:20: Fatal error: Python.h: No such file or directory
compilation terminated.
using profile: buildconf/default.ini
detected include path: ['/usr/lib/gcc/i686-linux-gnu/4.6.1/include','/usr/local/include', '/usr/lib/gcc/i686-linux-gnu/4.6.1/include-fixed', '/usr/include/i386-linux-gnu', '/usr/include']
Patching "bin_name" to properly install_scripts dir
...
最后我看到:
...
[gcc -pthread] spooler.o
*** uWsgi compiling embedded plugins ***
[gcc -pthread] plugins/python/python_plugin.o
----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/etc/apt/sources.list.d/build/uwsgi/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-joud1I-record/install-record.txt Failed with error code 1 in /etc/apt/sources.list.d/build/uwsgi
Storing complete log in /root/.pip/pip.log
有谁有任何建议如何安装最新的uwsgi?
问候,
格热戈日
解决方法:
plugins/python/uwsgi_python.h:2:20: Fatal error: Python.h: No such file or directory
要编译Python的C扩展,您需要Python开发文件:
$sudo apt-get install python2.7-dev
Python-Anaconda Apache mod_wsgi Ubuntu
我正在使用Ubuntu和Apache运行服务器.现在,我正在尝试使Anaconda与mod_wsgi一起工作,但无法使其工作.
首先.如果我使用mod_wsgi-express,它可以正常工作.通过遵循“安装到Python”部分中https://anaconda.org/pypi/mod_wsgi的说明,我可以通过首先设置PYTHONHOME = / opt / anaconda然后设置/ opt / anaconda3 / bin / mod_wsgi-express start-server使其工作.
我想使用Apache,所以我将anaconda的mod_wsgi模块加载到了Apache中.然后我有一个VirtualHost像这样:
WsgiPythonHome /opt/anaconda3
WsgiPythonPath /opt/anaconda3/lib/python3.6/site-packages:/path/to/application
<VirtualHost *:8080>
ServerName example.com
WsgiDaemonProcess example python-home=/opt/anaconda3 python-path=path/to/application:/opt/anaconda3/lib/python3.6/site-packages
WsgiProcessGroup example
WsgiScriptAlias / /path/to/application/wsgi.py
<Directory /path/to/application/static>
Require all granted
</Directory>
<Directory /path/to/application>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
</VirtualHost>
现在解决问题.我在我的Apache错误日志中收到此错误.如果不使用mod_wsgi_express指定PYTHONHOME = / opt / anaconda,则会收到相同的错误.
[Wed Mar 01 09:31:17.159233 2017] [core:trace4] [pid 16941] mpm_common.c(530): mpm child 19356 (gen 0/slot 1) started
[Wed Mar 01 09:31:17.159638 2017] [core:trace4] [pid 16941] mpm_common.c(530): mpm child 19357 (gen 0/slot 2) started
[Wed Mar 01 09:31:17.160049 2017] [core:trace4] [pid 16941] mpm_common.c(530): mpm child 19358 (gen 0/slot 6) started
[Wed Mar 01 09:31:17.160467 2017] [core:trace4] [pid 16941] mpm_common.c(530): mpm child 19359 (gen 0/slot 7) started
[Wed Mar 01 09:31:17.160967 2017] [core:trace4] [pid 16941] mpm_common.c(530): mpm child 19360 (gen 0/slot 8) started
[Wed Mar 01 09:31:17.161421 2017] [core:trace4] [pid 16941] mpm_common.c(530): mpm child 19361 (gen 0/slot 9) started
[Wed Mar 01 09:31:17.161877 2017] [core:trace4] [pid 16941] mpm_common.c(530): mpm child 19362 (gen 0/slot 10) started
[Wed Mar 01 09:31:17.162345 2017] [core:trace4] [pid 16941] mpm_common.c(530): mpm child 19363 (gen 0/slot 11) started
[Wed Mar 01 09:31:17.162792 2017] [wsgi:info] [pid 19361] mod_wsgi (pid=19361): Python home /opt/anaconda3.
[Wed Mar 01 09:31:17.162817 2017] [wsgi:info] [pid 19361] mod_wsgi (pid=19361): Initializing Python.
[Wed Mar 01 09:31:17.166761 2017] [wsgi:info] [pid 19362] mod_wsgi (pid=19362): Python home /opt/anaconda3.
[Wed Mar 01 09:31:17.166806 2017] [wsgi:info] [pid 19362] mod_wsgi (pid=19362): Initializing Python.
[Wed Mar 01 09:31:17.170927 2017] [wsgi:info] [pid 19360] mod_wsgi (pid=19360): Python home /opt/anaconda3.
[Wed Mar 01 09:31:17.170967 2017] [wsgi:info] [pid 19360] mod_wsgi (pid=19360): Initializing Python.
[Wed Mar 01 09:31:17.174897 2017] [wsgi:info] [pid 19359] mod_wsgi (pid=19359): Python home /opt/anaconda3.
[Wed Mar 01 09:31:17.174921 2017] [wsgi:info] [pid 19359] mod_wsgi (pid=19359): Initializing Python.
[Wed Mar 01 09:31:17.178746 2017] [wsgi:info] [pid 19363] mod_wsgi (pid=19363): Python home /opt/anaconda3.
[Wed Mar 01 09:31:17.178769 2017] [wsgi:info] [pid 19363] mod_wsgi (pid=19363): Initializing Python.
[Wed Mar 01 09:31:17.182570 2017] [core:notice] [pid 16941] AH00052: child pid 19317 exit signal Aborted (6)
[Wed Mar 01 09:31:17.182582 2017] [core:trace4] [pid 16941] mpm_common.c(530): mpm child 19317 (gen 0/slot 0) exited
[Wed Mar 01 09:31:17.182594 2017] [core:notice] [pid 16941] AH00052: child pid 19318 exit signal Aborted (6)
[Wed Mar 01 09:31:17.182597 2017] [core:trace4] [pid 16941] mpm_common.c(530): mpm child 19318 (gen 0/slot 3) exited
[Wed Mar 01 09:31:17.182605 2017] [core:notice] [pid 16941] AH00052: child pid 19319 exit signal Aborted (6)
[Wed Mar 01 09:31:17.182608 2017] [core:trace4] [pid 16941] mpm_common.c(530): mpm child 19319 (gen 0/slot 4) exited
[Wed Mar 01 09:31:17.182615 2017] [core:notice] [pid 16941] AH00052: child pid 19320 exit signal Aborted (6)
[Wed Mar 01 09:31:17.182618 2017] [core:trace4] [pid 16941] mpm_common.c(530): mpm child 19320 (gen 0/slot 5) exited
[Wed Mar 01 09:31:17.182636 2017] [wsgi:info] [pid 16941] mod_wsgi (pid=19321): Process 'store-test' has died but server is being stopped, deregister it.
[Wed Mar 01 09:31:17.182646 2017] [wsgi:info] [pid 16941] mod_wsgi (pid=19321): Process 'store-test' has been deregistered and will no longer be monitored.
[Wed Mar 01 09:31:17.182934 2017] [wsgi:info] [pid 19358] mod_wsgi (pid=19358): Python home /opt/anaconda3.
[Wed Mar 01 09:31:17.182954 2017] [wsgi:info] [pid 19358] mod_wsgi (pid=19358): Initializing Python.
[Wed Mar 01 09:31:17.186756 2017] [wsgi:info] [pid 19357] mod_wsgi (pid=19357): Python home /opt/anaconda3.
[Wed Mar 01 09:31:17.186781 2017] [wsgi:info] [pid 19357] mod_wsgi (pid=19357): Initializing Python.
[Wed Mar 01 09:31:17.190807 2017] [wsgi:info] [pid 19356] mod_wsgi (pid=19356): Python home /opt/anaconda3.
[Wed Mar 01 09:31:17.190840 2017] [wsgi:info] [pid 19356] mod_wsgi (pid=19356): Initializing Python.
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00007f4ad9333780 (most recent call first):
有人知道我可以做些什么来使其正常工作吗?
解决方法:
如果要使用Anaconda Python,则不能对mod_wsgi使用任何系统软件包.因此,第一步是卸载任何系统mod_wsgi软件包.
然后使用pip install mod_wsgi将mod_wsgi-express安装到您的Anaconda Python安装或虚拟环境中.
然后运行:
mod_wsgi-express module-config
取得输出,并将其放入您的Apache配置文件中以加载mod_wsgi.
然后将特定Wsgi应用程序的mod_wsgi配置添加到Apache.
如果有问题,请在此之后显示正在使用的配置.
Ubuntu 16.04 安装 anaconda3
首先下载 anaconda3 镜像,清华大学开源软件镜像站下载地址:https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
因为实验需要用到 tensorflow 环境,通过阅读大量博客发现,tensorflow 支持的 python 最高版本为 python3.5,为了避免不必要的错误和麻烦,我下载了 Anaconda3-4.2.0-Linux-x86_64 版本,里面自带 python3.5。
网盘链接:https://pan.baidu.com/s/1vSGLisE8Y1dZ3a7HrlM05A 提取码:q0nj
安装 anaconda3:
打开终端,进入 Anaconda3-4.2.0-Linux-x86_64 所在目录,执行以下命令。
接受许可,输入 yes,按回车:(一路 yes)
更新环境变量(如果不成功,重启虚拟机 )
检查是否安装成功。
打开以新的终端输入 python
成功界面
失败界面(虚拟机自带 python2.7 可以重启虚拟机)
参考:https://www.cnblogs.com/hezhiyao/p/8328634.html
我们今天的关于Ubuntu16.04上使用Anaconda3的Python3.6的pip安装UWSGI报错解决办法和ubuntu安装python3.6 的pip的分享就到这里,谢谢您的阅读,如果想了解更多关于Pip已安装到python3.6,但是我在Ubuntu 18.04上将python3.7与VS Code一起使用、python – 通过pip安装uwsgi 1.2.5、Python-Anaconda Apache mod_wsgi Ubuntu、Ubuntu 16.04 安装 anaconda3的相关信息,可以在本站进行搜索。
本文标签: