我想通过 conda 安装 python2.7,如下命令:
conda create -n tensorflow python=2.7 anaconda
但它缺少dbm
模块。
$ python
Python 2.7.15 | packaged by conda-forge | (default, Jul 2 2019, 00:39:44)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import dbm
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named dbm
>>> import Tkinter
>>>
然后我尝试安装python-gdbm
google和stackoverflow的建议。
$ conda install -n tensorflow -c anaconda python-gdbm
Collecting package metadata (current_repodata.json): done
Solving environment: done
## Package Plan ##
environment location: /public/home/miniconda2/envs/tensorflow
added / updated specs:
- python-gdbm
The following packages will be downloaded:
package | build
---------------------------|-----------------
certifi-2019.11.28 | py27_0 156 KB anaconda
python-gdbm-1.1 | py27_0 21 KB anaconda
------------------------------------------------------------
Total: 177 KB
The following NEW packages will be INSTALLED:
gdbm anaconda/linux-64::gdbm-1.12-0
python-gdbm anaconda/linux-64::python-gdbm-1.1-py27_0
The following packages will be UPDATED:
openssl conda-forge::openssl-1.1.1d-h516909a_0 --> anaconda::openssl-1.1.1-h7b6447c_0
The following packages will be SUPERSEDED by a higher-priority channel:
ca-certificates conda-forge::ca-certificates-2019.11.~ --> anaconda::ca-certificates-2019.11.27-0
certifi conda-forge --> anaconda
Proceed ([y]/n)? y
Downloading and Extracting Packages
python-gdbm-1.1 | 21 KB | ################################################################################################################################ | 100%
certifi-2019.11.28 | 156 KB | ################################################################################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
不幸的是,当import dbm
.
任何帮助深表感谢。谢谢。