我已经使用apt安装了python2和python3。
我试过用
$ virtualenv -p python3 testenv1并获取
Running virtualenv with interpreter /usr/local/bin/python3
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/virtualenv.py", line 22, in
import zlib
ImportError: No module named 'zlib'我已经搜索过了
$ sudo find / -name 'libz.*'
[sudo] password for x:
find: ‘/run/user/1000/gvfs’: Permission denied
/snap/core/7917/lib/x86_64-linux-gnu/libz.so.1
/snap/core/7917/lib/x86_64-linux-gnu/libz.so.1.2.8
/snap/core/7713/lib/x86_64-linux-gnu/libz.so.1
/snap/core/7713/lib/x86_64-linux-gnu/libz.so.1.2.8
/snap/core18/1144/lib/x86_64-linux-gnu/libz.so.1
/snap/core18/1144/lib/x86_64-linux-gnu/libz.so.1.2.11
/snap/core18/1192/lib/x86_64-linux-gnu/libz.so.1
/snap/core18/1192/lib/x86_64-linux-gnu/libz.so.1.2.11
/usr/lib/x86_64-linux-gnu/libz.so
/usr/lib/x86_64-linux-gnu/libz.a
/lib/x86_64-linux-gnu/libz.so.1.2.11
/lib/x86_64-linux-gnu/libz.so.1有什么方法可以使用apt来用zlib安装python3呢?
如果没有,请你指点我清楚说明如何进行?
谢谢!
发布于 2019-10-11 16:25:13
步骤1:使用apt的搜索功能
$ apt search python3 zlib
Sorting... Done
Full Text Search... Done
python3-netcdf4/disco 1.4.2-1build1 amd64
Python 3 interface to the netCDF4 (network Common Data Form) library第二步:使用apt的显示功能来确定它是否是您真正想要的包。
$ apt show python3-netcdf4
Package: python3-netcdf4
Version: 1.4.2-1build1
Priority: optional
Section: universe/python
Source: netcdf4-python
Origin: Ubuntu
Maintainer: Ubuntu Developers
Original-Maintainer: Debian GIS Project
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 1,599 kB
Depends: python3 (<< 3.8), python3 (>= 3.7~), python3-cftime, python3-numpy (>= 1:1.14.3), python3-numpy-abi9, python3:any, libc6 (>= 2.14), libhdf5-103, libnetcdf13 (>= 1:4.4.0)
Homepage: http://unidata.github.io/netcdf4-python/
Download-Size: 476 kB
APT-Sources: http://us.archive.ubuntu.com/ubuntu disco/universe amd64 Packages
Description: Python 3 interface to the netCDF4 (network Common Data Form) library
NetCDF version 4 has many features not found in earlier versions of the
library and is implemented on top of HDF5. This module can read and write
files in both the new netCDF 4 and the old netCDF 3 format, and can create
files that are readable by HDF5 clients. The API is modelled after
Scientific.IO.NetCDF, and should be familiar to users of that module.
.
Most new features of netCDF 4 are implemented, such as multiple unlimited
dimensions, groups and zlib data compression. All the new numeric data types
(such as 64 bit and unsigned integer types) are implemented. Compound and
variable length (vlen) data types are supported, but the enum and opaque data
types are not. Mixtures of compound and vlen data types (compound types
containing vlens, and vlens containing compound types) are not supported.
.
This package contains the netCDF 4 module for Python 3.如果没有一个apt包提供您想要的,那么就开始查看pip包。
https://askubuntu.com/questions/1180338
复制相似问题