Tried to import the excel module but this is the result,
>>> pip install openpyxl==2.1.4
File "<stdin>", line 1
pip install openpyxl==2.1.4
^
SyntaxError: invalid syntax
As seen, I also don't have the excel module,
>>>import openpyxl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'openpyxl'
pip is used on the command line. To use it in the shell:
>>> import pip
>>> pip.main(['install', 'openpyxl==2.1.4'])
Or just type it into your Terminal or Command Prompt application to run the command.
Related
I've used pip install pymatgen with Python 3.9.1 on Windows 10 to install pymatgen, but I'm getting the following error:
Traceback (most recent call last):
File "D:\code\pymatgen\pymatgen.py", line 1, in <module>
import pymatgen.core as mg
File "D:\code\pymatgen\pymatgen.py", line 1, in <module>
import pymatgen.core as mg
ModuleNotFoundError: No module named 'pymatgen.core'; 'pymatgen' is not a package
I have also tried to install the previous 2 versions but still getting the same error though I can already see it in the pip list
pymatgen 2022.3.22
What am I missing?
Maybe try using conda ? if this doesn't work then there is definitely some dependencies issue
https://pymatgen.org/installation.html
I have looked at other answers such as conda install future and others but none seem to solve this error. Everything was working till yesterday but today when I am trying to run my script I get this error.
I initially thought that I had multiple pandas packages from pip and conda so I uninstalled from both and then installed via conda again. But the error still persists.
I have installed python 3.6 as a separate environment in anaconda 2.
Traceback (most recent call last):
File "/Users/amit/anaconda2/envs/python36/lib/python3.6/site-packages/pandas/compat/__init__.py", line 49, in <module>
import __builtin__ as builtins
ModuleNotFoundError: No module named '__builtin__'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 18, in <module>
from nameserver import NameServer
File "/Users/amit/Work/ml/marl/nameserver.py", line 4, in <module>
import pandas as pd
File "/Users/amit/anaconda2/envs/python36/lib/python3.6/site-packages/pandas/__init__.py", line 23, in <module>
from pandas.compat.numpy import *
File "/Users/amit/anaconda2/envs/python36/lib/python3.6/site-packages/pandas/compat/__init__.py", line 62, in <module>
import http.client as httplib
ModuleNotFoundError: No module named 'http.client'
=============
EDIT 1
Following #EvgenyPogrebnyak's advice I created a new env named py36. I tried running the print statement python -c "import pandas as pd; print(pd.__version__)" statement from the home directory or infact any other directory it runs fine but when I run it from my project directory I get this particular error, which is weird.
amit:~ $source activate py36
(py36) amit:~ $python -c "import pandas as pd; print(pd.__version__)"
0.23.0
(py36) amit:~ $cd Work/ml/marl/
(py36) amit:~/Work/ml/marl $python -c "import pandas as pd; print(pd.__version__)"
Traceback (most recent call last):
File "/Users/amit/anaconda2/envs/py36/lib/python3.6/site-packages/pandas/compat/__init__.py", line 49, in <module>
import __builtin__ as builtins
ModuleNotFoundError: No module named '__builtin__'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/amit/anaconda2/envs/py36/lib/python3.6/site-packages/pandas/__init__.py", line 23, in <module>
from pandas.compat.numpy import *
File "/Users/amit/anaconda2/envs/py36/lib/python3.6/site-packages/pandas/compat/__init__.py", line 62, in <module>
import http.client as httplib
ModuleNotFoundError: No module named 'http.client'
I think code below should run. Exit enviornments is you are in one before running.
conda create -n new1 python=3.6 pandas
source activate new1
python --version
# expected:
# Python 3.6.0 :: Anaconda 4.3.0 (32-bit)
python -c "import pandas as pd; print(pd.__version__)"
# expected '0.22.0',but more importantly this shows pandas in imported
Does this run? You can install more libraries requred with conda install -n new1 <package> then try:
python /Users/amit/Work/ml/marl/nameserver.py
Similar result can be achieved with pipenv.
I am using Windows 10.
I just tried in my Anaconda prompt: pip install email
I got the following error:
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Anaconda\lib\site-packages\setuptools-27.2.0-py3.6.egg\setuptools\__init__.py", line 10, in <module>
File "C:\Anaconda\lib\site-packages\setuptools-27.2.0-py3.6.egg\setuptools\extern\__init__.py", line 1, in <module>
File "C:\Anaconda\lib\site-packages\setuptools-27.2.0-py3.6.egg\pkg_resources\__init__.py", line 35, in <module>
File "C:\Users\DIMITR~1.LIA\AppData\Local\Temp\pip-build-1vvnmrhi\email\email\parser.py", line 10, in <module>
from cStringIO import StringIO
ModuleNotFoundError: No module named 'cStringIO'
Looks like there is no need to install email via pip. Just import it in your Python code.
The error is saying that you do not have the package cStringIO.
To resolve this use following:
pip install cStringIO
if this does not help, try:
pip install StringIO
Here is more documentation about the packages StringIO and cStringIO https://docs.python.org/2/library/stringio.html
I want to use ATD module in python, I downloaded it throught the command line pip install ATD, and it was Successfully installed. But when I wanna use it in python, it says that the module is not found, does anyone know what's wrong with it, and how can i fix it?
>>> import ATD
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import ATD
ModuleNotFoundError: No module named 'ATD'
According to the documentation of rope-vim plugin I install python-rope and python-ropemode mode packages. However when I try to open some file using vim I get following ImportError:
Error detected while processing function LoadRope:
line 4:
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named ropevim
I have found the ropevim module is already in plugin's directory but when I had tried to import it:
python -c "import ropevim"
I get another ImportError:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "ropevim.py", line 10, in <module>
import vim
ImportError: No module named vim
Have I miss any package? Some ideas? Thank you for your help.
Install ropevim using pip install ropevim
ropevim is currently a Python 2 project.
pip2 install --user --update ropevim
I know it might not be the answer you're looking for, but I'm using klen/python-mode plugin with rope included and it's working like a charm.
I'm also using Vim-Plug to manage my plugins and it's as easy as:
Plug 'klen/python-mode', { 'for': ['python'] }
Here is my .vimrc
Hope this helps! :)