ImportError: No module named 'bottle' in PyCharm
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
PyCharm: ImportError no module named X?
SHORTER VERSION:
If you have squiggly line below module you import...
...move on name of module and press Alt+Enter and select Install package X
.
This should (probably !!!) install module you thought you installed, but got ImportError
.
LONGER:
If you want to use module X:
Go to File -> Settings -> Project:NameOfProject -> Project Interpreter
.
The window that opens has some specific regions:
- This is a project interpreter PyCharm is currently using. You can change you python environments here also. If you want to add virtual environment you created manually, continue reading.
- A little "cog" or a "gear" is used to Add, Edit or Remove environments. If you want to add virtual environment you created manually, select
Add...
when gear icon is clicked, and make sure to set proper path topython.exe
of your virtual environment. - IMPORTANT: A list of all installed packages, represented by: Package name and Version. If you tried to use package, but got
ImportError no module named 'X'
, make sure to check if package is listed here!!!. If not, it's not installed in the current python environment and it should be installed (continue reading). A little + represents
Install
. It can be used to install packages. Simply click on + sign, search for a package and clickInstall Package
at the bottom after you found it. You can also specify the version you want of a package. In example below, we searched forflask
package.
A package should be installed and listed now in installed packages.
Python - No module named my_module in terminal, but not in PyCharm
The PYTHONPATH in your terminal environment doesn't contain 'my_module'.
Configure the PYTHONPATH to include the directory containing your module
It works in pycharm because it sets up the path for you automagically.
Learn about the module search path
Related Topics
Convert Python Strings into Floats Explicitly Using the Comma or the Point as Separators
String Comparison Doesn't Seem to Work for Lines Read from a File
How to Print a Percentage Value in Python
Integer Overflow in Numpy Arrays
Use Aws Glue Python with Numpy and Pandas Python Packages
Why Does Map Return a Map Object Instead of a List in Python 3
Rename Nested Field in Spark Dataframe
How to Isolate Everything Inside of a Contour, Scale It, and Test the Similarity to an Image
Get Class Labels from Keras Functional Model
Unicodeencodeerror: 'Ascii' Codec Can't Encode Character '\Xe9' - -When Using Urlib.Request Python3
Expand the Line with Specified Width in Data Unit
Rect Collision with List of Rects
Python: Sorting Items from Top Left to Bottom Right with Opencv
Using Django Database Layer Outside of Django
Django What Is Reverse Relationship
Python Slice How-To, I Know the Python Slice But How to Use Built-In Slice Object for It