ImportError: No module named IPython
Ok, finally i achieved my goal.
- I wrote ipython --version but i found, it was not installed.
- I tried to install it, with pip. I went to C:\Python27\Scripts, here is pip, you can try in this directory, or add to environment variables.
- I tried to install ipython, but i found a error
error: Unable to find vcvarsall.bat
so i installed visual studio c++ 9.0, the version to python 2.7.
- pip install ipython
ImportError: No module named when trying to run Python script
This issue arises due to the ways in which the command line IPython interpreter uses your current path vs. the way a separate process does (be it an IPython notebook, external process, etc). IPython will look for modules to import that are not only found in your sys.path, but also on your current working directory. When starting an interpreter from the command line, the current directory you're operating in is the same one you started ipython in. If you run
import os
os.getcwd()
you'll see this is true.
However, let's say you're using an ipython notebook, run os.getcwd()
and your current working directory is instead the folder in which you told the notebook to operate from in your ipython_notebook_config.py file (typically using the c.NotebookManager.notebook_dir
setting).
The solution is to provide the python interpreter with the path-to-your-module. The simplest solution is to append that path to your sys.path list. In your notebook, first try:
import sys
sys.path.append('my/path/to/module/folder')
import module_of_interest
If that doesn't work, you've got a different problem on your hands unrelated to path-to-import and you should provide more info about your problem.
The better (and more permanent) way to solve this is to set your PYTHONPATH, which provides the interpreter with additional directories look in for python packages/modules. Editing or setting the PYTHONPATH as a global var is os dependent, and is discussed in detail here for Unix or Windows.
ipython iptest ImportError( no module named ipython)
I guess you create your virtual environment with --system-site-packages
.
Try following steps:
- Exit virtual environment:
deactivate
- Switch to superuser:
su root
- Install jupyter outside the virtual environment:
sudo pip3 install jupyter
Then enter your virtual environment and try again.
Related Topics
How to Run an External Command Asynchronously from Python
Authenticate from Linux to Windows SQL Server with Pyodbc
Importerror: Libcblas.So.3: Cannot Open Shared Object File: No Such File or Directory
How to Prevent Numbers Being Changed to Exponential Form in Python Matplotlib Figure
Unnest (Explode) a Pandas Series
How to Read First N Lines of a File
Why Isn't Pycharm's Autocomplete Working for Libraries I Install
Split a Large Pandas Dataframe
Python Operator Precedence of in and Comparison
Windows Scipy Install: No Lapack/Blas Resources Found
Circular Shift of Vector (Equivalent to Numpy.Roll)
When Does Python Allocate New Memory for Identical Strings
How to Activate an Anaconda Environment