PYNQ-Z2自帶python3.6唆樊,苦于沒有可用的TensorFlow安裝包,但是找到了python3.4版本對應的armv7版的TensorFlow刻蟹,只能自己再安裝python3.4逗旁。
編譯安裝完Python3.4之后,使用pip3安裝python庫舆瘪,發(fā)現(xiàn)了如下報錯:
(發(fā)現(xiàn)網(wǎng)上很多Ubuntu更新python3后出現(xiàn)此問題)
pip3 is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting numpy
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/numpy/
.
.
.
Could not fetch URL https://pypi.python.org/simple/numpy/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/numpy/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)) - skipping
Could not find a version that satisfies the requirement numpy (from versions: )
No matching distribution found for numpy
網(wǎng)上找了很多片效,大多數(shù)解決辦法是
./configure --with-ssl
... ...
configure: WARNING: unrecognized options: --with-ssl
然而并沒有什么用!
參考https://blog.csdn.net/yuezhuo_752/article/details/84140168的方法英古,重新安裝openssl淀衣,但是由于PYNQ是arm平臺,編譯安裝太慢太慢了召调。膨桥。。
終于安裝完了唠叛,重新編譯python3.4只嚣,仍然報錯!R照印册舞!崩潰。澳厢。环础。
然后參考http://www.cnblogs.com/minglee/p/9232673.html的方法囚似,安裝openssl相關的一堆東西,然而找不到O叩谩饶唤!
apt-get install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel
但是他的思路啟發(fā)了我,我開始查看setup.py文件
# Detect SSL support for the socket module (via _ssl)
search_for_ssl_incs_in = [
'/usr/local/ssl/include',
'/usr/contrib/ssl/include/'
]
ssl_incs = find_file('openssl/ssl.h', inc_dirs,
search_for_ssl_incs_in
)
if ssl_incs is not None:
krb5_h = find_file('krb5.h', inc_dirs,
['/usr/kerberos/include'])
if krb5_h:
ssl_incs += krb5_h
ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
['/usr/local/ssl/lib',
'/usr/contrib/ssl/lib/'
] )
if (ssl_incs is not None and
ssl_libs is not None):
exts.append( Extension('_ssl', ['_ssl.c'],
include_dirs = ssl_incs,
library_dirs = ssl_libs,
libraries = ['ssl', 'crypto'],
depends = ['socketmodule.h']), )
else:
missing.append('_ssl')
其中:inc_dirs = self.compiler.include_dirs + ['/usr/include']
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
然后開始檢查系統(tǒng)內(nèi)是不是存在這兩個頭文件
可喜的是存在ssl.h這個文件
root@pynq:/usr/include# cd openssl/
root@pynq:/usr/include/openssl# ls
aes.h cms.h ecdsa.h md5.h rand.h ssl3.h
asn1.h comp.h ec.h mdc2.h rc2.h ssl.h
.
.
.
可悲的是 并沒有krb5.h 贯钩!
開始解決沒有krb5.h的問題募狂,發(fā)現(xiàn)需要安裝kerberos套件,參考http://www.reibang.com/p/fc2d2dbd510b
未完待續(xù)....