我的python解释器是:
(base) ➜ ~ which python
/home/markd/anaconda3/bin/python
我通过conda install -c conda-forge umap-learn
安装了UMAP,然后在pythonshell中运行良好,例如
(base) ➜ ~ python
Python 3.7.4 (default, Aug 13 2019, 20:35:49)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import umap
>>> print(umap.__version__)
0.3.10
但是,如果运行python testumap.py
或python -u testumap.py
,则失败:
(base) ➜ ~ cat testumap.py
import umap
print(umap.__version__)
(base) ➜ ~ python testumap.py
Traceback (most recent call last):
File "testumap.py", line 1, in <module>
import umap
File "testumap.py", line 2, in <module>
print(umap.__version__)
AttributeError: module 'umap' has no attribute '__version__'
我不知道怎么了。是因为康达还是UMAP?你知道吗
我尝试导入和打印其他已安装库的版本,它们在pythonshell或Python参数(Python)中显示相同的输出xxx年). 你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐