简体   繁体   English

Python3错误:pip安装后没有名为telebot的模块

[英]Python3 ERROR:no module named telebot after pip installed it

python 3.5.2 // Ubuntu 16.04 LTS python 3.5.2 // Ubuntu 16.04 LTS

I've installed pyTelegramBotAPI to code bots for telegram using this command:我已经安装了 pyTelegramBotAPI 来使用以下命令为电报编写机器人:

pip instal pyTelegramBotAPI

Result:结果:

Collecting pyTelegramBotAPI
Requirement already satisfied: six in /home/username/.local/lib/python2.7/site-packages (from pyTelegramBotAPI) (1.11.0)
Collecting requests (from pyTelegramBotAPI)
  Using cached https://files.pythonhosted.org/packages/49/df/50aa1999ab9bde74656c2919d9c0c085fd2b3775fd3eca826012bef76d8c/requests-2.18.4-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests->pyTelegramBotAPI)
  Using cached https://files.pythonhosted.org/packages/7c/e6/92ad559b7192d846975fc916b65f667c7b8c3a32bea7372340bfe9a15fa5/certifi-2018.4.16-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests->pyTelegramBotAPI)
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting idna<2.7,>=2.5 (from requests->pyTelegramBotAPI)
  Using cached https://files.pythonhosted.org/packages/27/cc/6dd9a3869f15c2edfab863b992838277279ce92663d334df9ecf5106f5c6/idna-2.6-py2.py3-none-any.whl
Collecting urllib3<1.23,>=1.21.1 (from requests->pyTelegramBotAPI)
  Using cached https://files.pythonhosted.org/packages/63/cb/6965947c13a94236f6d4b8223e21beb4d576dc72e8130bd7880f600839b8/urllib3-1.22-py2.py3-none-any.whl
Installing collected packages: certifi, chardet, idna, urllib3, requests, pyTelegramBotAPI

Then, I imported it into my source code:然后,我将它导入到我的源代码中:

import telebot

However, when I run the code I get the following error:但是,当我运行代码时,出现以下错误:

    Traceback (most recent call last):
      File "firstBot.py", line 1, in <module>
        import telebot
    ImportError: No module named 'telebot'

It mostly happens for Linux Users, because there is a preinstalled python(version 2.x) in the shell, When you install a new module or run your app with default python , it runs and serves by python2.x .这主要发生在 Linux 用户身上,因为 shell 中有一个预装的 python(版本 2.x),当你安装一个新模块或使用默认python运行你的应用程序时,它运行并由python2.x提供服务。 You should use pip3 when you installing it, or run your app by python3 app_main_file.py你应该在安装时使用pip3 ,或者通过python3 app_main_file.py运行你的应用程序

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Python3:没有名为 pip 的模块 - Python3: No module named pip 安装pip后没有名为“ pip”的模块 - No module named 'pip' after pip installed ModuleNotFoundError:没有名为“pip”python3的模块 - ModuleNotFoundError: No module named 'pip' python3 ModuleNotFoundError: No module named &#39;psycopg2&#39; (python3, mac, pip3 显示 psycopg2 已成功安装) - ModuleNotFoundError: No module named 'psycopg2' (python3, mac, pip3 shows psycopg2 successfully installed) 使用 pip3 安装后未找到 Python3 模块错误 - Python3 module not found error after installation with pip3 为什么即使在我通过 pip 安装了模块后,还是会收到“没有名为 scipy 的模块”错误? - Why do I receive a “no module named scipy” error even after I have installed the module via pip? /usr/local/bin/python3:第 85 行或附近没有名为 pip 的模块错误; 以状态 1 退出 - /usr/local/bin/python3: No module named pip Error on or near line 85; exiting with status 1 ModuleNotFoundError:没有名为“pynput”的模块 Python3 和 pip3 - ModuleNotFoundError: No module named 'pynput' Python3 and pip3 Python setuptools - 没有以 pip install 命名的模块 - Python setuptools - no module named after pip install 在pip安装后出错“没有名为six的模块” - Error “no module named six” after a pip install
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM