Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: No module named 'bottle' - PyCharm

I installed bottle on python3.4 with pip install. In terminal, when I do:

$ python3.4 >>>import bottle # shows no import error >>>  

but when I do it in PyCharm, it says "import bottle ImportError: No module named 'bottle'"

like image 469
Tinno TL Avatar asked Sep 26 '14 22:09

Tinno TL


People also ask

What is Python interpreter PyCharm?

Python interpreters in PyCharmA virtual environment consists of a base interpreter and installed packages. With PyCharm Professional, you can also configure interpreters to execute your Python code on remote environments: SSH, Vagrant, WSL (only for Windows), Docker, and Docker Compose.


2 Answers

in your PyCharm project:

  • press Ctrl+Alt+s to open the settings
  • on the left column, select Project Interpreter
  • on the top right there is a list of python binaries found on your system, pick the right one
  • eventually click the + button to install additional python modules
  • validate

enter image description here

like image 166
Thomasleveil Avatar answered Sep 28 '22 03:09

Thomasleveil


In some cases no "No module ..." can appear even on local files. In such cases you just need to mark appropriate directories as "source directories":

Mark as source lib directory

like image 37
Ivan Talalaev Avatar answered Sep 28 '22 04:09

Ivan Talalaev