点安装成功,但导入时仍然出现“无模块”错误

时间:2019-05-08 11:02:24

标签: python-3.x pip

我在pypi网站“ sndboxapi”上创建了一个新的pip包,我可以进行pip安装sndboxapi,但无法将其导入代码中。

我已经创建了一系列环境,但是它们都可以安装,但不仅仅是不允许我使用该模块。

robot@Robot:~/Documents$ python3 -m venv test

robot@Robot:~/Documents$ source test/bin/activate

(test) robot@Robot:~/Documents$ which python
  

/ home / robot / Documents / test / bin / python

(test) robot@Robot:~/Documents$ python
  

Python 3.6.7(默认,2018年10月22日,11:32:17)

(test) robot@Robot:~/Documents$ pip --version
  来自/home/robot/Documents/test/lib/python3.6/site-packages的

pip 9.0.1   (python 3.6)

(test) robot@Robot:~/Documents$ pip install sndboxapi
  

收集sndboxapi

     

使用缓存   https://files.pythonhosted.org/packages/5a/74/b2ef5a92483209b1a3225ffcba180a25bac517f7b2670eb0dabe43f6fa7f/sndboxapi-1.3-py3-none-any.whl

     

安装收集的软件包:sndboxapi

     

成功安装了sndboxapi-1.3

(test) robot@Robot:~/Documents$ pip list
  

DEPRECATION:默认格式将在将来切换为列。   您可以使用--format =(legacy | columns)(或定义一个   在[list]部分下的pip.conf中,format =(legacy | columns)   禁用此警告。点(9.0.1)

     

pkg-resources(0.0.0)

     

setuptools(39.0.1)

     

sndboxapi(1.3)

(test) robot@Robot:~/Documents$ python
  

Python 3.6.7(默认,2018年10月22日,11:32:17)

>>> import sndboxapi
  

回溯(最近通话最近一次):

     

文件“ ”,位于

的第1行      

ModuleNotFoundError:没有名为“ sndboxapi”的模块

我希望输出允许我导入模块,然后允许我调用函数。

1 个答案:

答案 0 :(得分:0)

Docs说:

from sndbox import sndboxapi
相关问题