基于ubuntu 无法import Theano

本文解决了一个常见的Python环境问题,即当pip尝试从TLS/SSL位置下载资源时,由于Python环境中SSL模块不可用导致的错误。文中详细记录了错误信息,包括读取超时、权限拒绝及编译失败等问题,并提供了可能的解决方案,如使用`--user`选项、检查权限、重新编译以及更新pip版本。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

出现问题:

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

 

ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

 

ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/pip'

Consider using the `--user` option or check the permissions.

 

You are using pip version 10.0.1, however version 19.2.1 is available.

You should consider upgrading via the 'pip install --upgrade pip' command.

 

Successfully installed pip

 

Could not find any downloads that satisfy the requirement pip3.7

Cleaning up...

No distributions at all found for pip3.7

Storing debug log for failure in /root/.pip/pip.log

 

Exception: Compilation failed (return status=1): /usr/bin/ld: /usr/local/lib/libpython3.7m.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC. /usr/local/lib/libpython3.7m.a: error adding symbols: Bad value. collect2: error: ld returned 1 exit status.

 

最后就是recompile with -fPIC. 这个编译的问题

 

如果解决了  按照教程安装就行,需要注意如下两个步骤

5 安装scikit-neuralnetwork

这一步前需要 :sudo pip install scikit-neuralnetwork

 

cd scikit-neuralnetwork; python setup.py develop

如果安装不了,需要添加权限

Sudo python setup.py develop

 

8

python examples/bench_mnist.py (sknn|lasagne)

后面跟一个 sknn 就行

 

ubuntu下载文件:

Pwd:看当前目录

下载方法:git clone + 对应链接

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值