Pyp3 gives ModuleNotFoundError even if packaged is install - python

So I'm trying to figure out if I can speed up my code. For that purpose I installed pyp3. But when I try to run the python file using pyp3 I get error in the first line itself ModuleNotFoundError, But when I use simple python my code works smoothly. Is it due to python version difference ? I'm new to pyp3. Any suggestion/help would be appreciated. Thankyou
pypy3 main_feature_extraction.py
Traceback (most recent call last):
File "main_feature_extraction.py", line 1, in <module>
from dotenv import find_dotenv, load_dotenv
ModuleNotFoundError: No module named 'dotenv'

Related

Can't import pymatgen.core "No module named 'pymatgen.core'"

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

Python Path error - No Module Found error

I'm having issues running ortools on Linux. I downloaded it from google's site (https://developers.google.com/optimization/) and installed it using "make install," but when I go to use it in python I get the following:
Traceback (most recent call last):
File "regular.py", line 42, in <module>
from ortools.constraint_solver import pywrapcp
File "/home/m3/summer/ortools_examples/examples/python/ortools.py", line 2, in <module>
ImportError: No module named linear_solver
It looks like despite installing ortools, its still not in my python path correctly, so when I call it in the file, it doesn't find anything and returns an error, right? Any advice on how to solve this?

sompy Module Import Error

I can't import the sompy module even though I installed it successfully, and it appears in the modules list of my python environment:
When I try to import the sompy module using the following statement:
import sompy
I get the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'sompy'
What's wrong?
Which interpreter/IDE are you using? If using PyCharm, the problem could be that PyCharm hasn't identified a root folder for your .py project.
I would try and recreate the root folder as a subfolder and right click > Make source directory.

Graphite install error 0.10.0-alpha

I get the following error when starting Graphite-web using DJango.
0.9.15 works ok, but I am looking to use the new "mapSeries" function available in 0.10.x
Seems to be a missing import -
Exception occurred processing WSGI script '/opt/graphite/conf/graphite.wsgi'.
Traceback (most recent call last):
File "/opt/graphite/conf/graphite.wsgi", line 46, in <module>
import graphite.metrics.search # noqa
File "/opt/graphite/webapp/graphite/metrics/search.py", line 6, in <module>
from graphite.storage import is_pattern, match_entries
ImportError: cannot import name match_entries
I'm not a python programer, but maybe the package is missing in the setup.py?
https://github.com/graphite-project/graphite-web/blob/master/setup.py
I solved the issue by updating /opt/graphite/conf/graphite.wsgi to the latest example version.
The 0.9.x version is not compatible with 0.10.x

How to install mathplotlib - python

I'm using sublime text 2 to run python 2.7. I have downloaded and installed mathplotlib. When I type the code:
import matplotlib.pyplot
I'm getting this error.
Traceback (most recent call last):
File "/Volumes/HP v190b/Python - Squash Coursework/squashFINAL.py", line 212, in <module>
import matplot.pyplot as plt
ImportError: No module named matplot.pyplot
Any ideas why? I'm using a Mac!
You may check the dependencies, sometimes you need to install some dependencies so that you can import certain module, take a look at this link http://matplotlib.org/users/installing.html

Categories

Resources