0

Hello everyone I am learning Python. While using Spyder I finished writing my own function (test.py) I saved the script in a new folder. In Spyder I made sure to change my working directory to where the test.py is located as well as the PYTHON PATH. Now when I try to import test it says in the console that there are no modules named 'test'. Any help will be appreciated thank you

2 Answers 2

1

Thank you Alex yeah the problem was I was not working in the same directory as the package I made so I opened up the command prompt in Spyder, went into the correct directory and was able to import/install it with no issues!!!

Sign up to request clarification or add additional context in comments.

Comments

0

have you tried

import sys
sys.path.append('path/to/test.py')
import test

if you want to import test inside of another script, the most sure-fire method is to just have both scripts in the same directory

1 Comment

Thank you for the feedback I will try it out

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.