A. Basit Khan
A. Basit Khan

Reputation: 25

Python module not found when using MSIPred

I am very new to python. I am trying to use a pre-existing algorithm on my data: https://github.com/wangc29/MSIpred

I downloaded the code from GitHub and used my command line installer as suggested on the first instruction of the vignette in the above link.

I save a python file in the same directory as the downloaded code and attempt to execute the first line:

import MSIpred as mp

I receive this error:

Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    import MSIpred as mp
ImportError: No module named MSIpred

This is my directory organization. I have tried with both MSI_Smoker and MSI_Smoker2 as seen in the image below. 1

Any suggestions?

Edit: In response to some comment, I tried moving the python script into the parent folder but I get the same error. Directory 2

Upvotes: 1

Views: 78

Answers (1)

ElapsedSoul
ElapsedSoul

Reputation: 825

The easiest way is to add the lib path to the environment parameter PYTHONPATH(https://www.tutorialspoint.com/What-is-PYTHONPATH-environment-variable-in-Python)

export PYTHONPATH=$PYTHONPATH:`pwd`  (replace `pwd` to the lib path)

link Python error "ImportError: No module named"

Upvotes: 1

Related Questions