the model i used was implementing using scikit-learn==0.18, i try to install it but it fails,so i install scikit-learn==1.2.1. however, this error keeping appears for me and i dont have any idea how to fix it.
Traceback (most recent call last):
File "run_DeepDDI.py", line 51, in <module>
preprocessing.calculate_pca(similarity_profile, pca_similarity_profile, pca_model)
File "/content/deepddi/deepddi/preprocessing.py", line 80, in calculate_pca
pca = cPickle.load(fid)
ModuleNotFoundError: No module named 'sklearn.decomposition.pca'
also,the model used cPickle and it is removed so i fix it as " import pickle as cPickle".
i dont know if that affects the code
Make a New Python Virtual Environment and again install scikit-learn in your newly made Virtual Virtual . I Hope, it will work properly.
Related
I'm running this github project: https://github.com/Biomatter-Designs/ProteinGAN
the second step says 2. Run the training script with python train_gan. but when I run the file I get:
/usr/local/bin/python3 /Users/user/Desktop/ProteinGAN-master/src/gan/train_gan.py
Traceback (most recent call last):
File "/Users/user/Desktop/ProteinGAN-master/src/gan/train_gan.py", line 8, in <module>
from gan.models import get_model, get_specific_hooks
ModuleNotFoundError: No module named 'gan'
I don't understand why it thinks the GAN folder is a module.
Had the issue error trying to import gan files on google colab.
I corrected my /content/gdrive folder to the exact path and it worked.
I hope this helps out.
When I try to use installed packages in Python, I nearly always run into the same error.
So I e.g. install a package like this: pip3 install mathplot and when I afterwards want to use it in Python3 (I use python3 in the command prompt), I run into the ModuleNotFoundError:
>>> import mathplot
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'mathplot'
But when I run just python, the module is found and ready to use.
Any idea where this problem comes from and how I can get rid of it?
Thanks in advance
This is a FRESH installation of Anaconda, so the issues with updating python don't apply here. Uninstalling and reinstalling causes the same errors.
Upon starting up the Anaconda prompt I get this error:
Traceback (most recent call last):
File "D:\AnacondaInstallation\Scripts\conda-script.py", line 11, in <module>
from conda.cli import main
ModuleNotFoundError: No module named 'conda'
C:\Users\xianx>where conda
INFO: Could not find files for the given pattern(s).
I manually added these three lines to my Path variable, but I'm still getting that error upon opening up the Anaconda prompt.
D:\AnacondaInstallation\Scripts,
D:\AnacondaInstallation,
D:\AnacondaInstallation\Library\bin
I also see it when I try to install any sort of package. The system seems to recognize the conda command enough to run conda-script.py.
D:\AnacondaInstallation\Scripts>conda install pytorch
Traceback (most recent call last):
File "D:\AnacondaInstallation\Scripts\conda-script.py", line 11, in <module>
from conda.cli import main
ModuleNotFoundError: No module named 'conda'
D:\AnacondaInstallation\Scripts>where conda
D:\AnacondaInstallation\Scripts\conda.exe
D:\AnacondaInstallation\Library\bin\conda.bat
My problem was that I had multiple Python installations all over the place. Once I cleaned those out of my PATH environment variable and put in the Anaconda ones, the issue resolved itself.
I am working with elffile python module/library. There is one line of code that is giving the following error
Traceback (most recent call last):
File "elffile.py", line 36, in <module>
import coding
ImportError: No module named coding
I could not find any python file or class named coding. Also, I didn't find anything on the internet regarding import coding.
Import is when you import modules to use in your coding.
If it cant find the module you probably have to install it. The easiest way to do this is to use pip.
Write: pip install coding (or pip3) and it will install the module.
I keep getting the following error, when using tensorflow in PyCharm:
/home/user/tensorflow/bin/python /home/user/PycharmProjects /TensorPlay/hello.py
Traceback (most recent call last):
File "/home/user/PycharmProjects/TensorPlay/hello.py", line 2, in <module>
import tensorflow as tf
File "/home/user/tensorflow/lib/python3.5/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/home/user/tensorflow/lib/python3.5/site-packages/tensorflow/python/__init__.py", line 27, in <module>
import ctypes
File "/usr/lib/python3.5/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ImportError: /home/user/tensorflow/lib/python3.5/lib-dynload/_ctypes.cpython-35m-x86_64-linux-gnu.so: undefined symbol: _PyUnicode_AsWideCharString
Process finished with exit code 1
hello.py is this simple example code:
import tensorflow as tf
node1 = tf.constant(3.0, tf.float32)
node2 = tf.constant(4.0)
print(node1, node2)
PyCharm detects all the Tensorflow elements and autocomplete everything i want to.
I also tried to run the virtualenv in the console.
Any Python related leads to the same error. I tried to upgrade tensorflow with
source ~/tensorflow/bin/activate
pip3 install --upgrade tensorflow
and had the exact same error too (Just instead of hello.py there was an error in file pip3)
Any suggestions?
EDIT:
I guess I see the problem. Might it be that my virtualenv wants Python 3.5.3? I thing with the last upgrade my Linux upgraded to Python 3.5.4 How can I fix it without creating a new virtualenv? And how I can make sure it doesn't happen on future updates?
I could only fix the issue with deleting the old virtualenv and setting up a new one.