1

I'm sure I'm doing something wrong(i.e. stupid), but running

from stuff.modules import maths

Pylint just keeps giving

No name 'modules' in module 'stuff' pylint(no-name-in-module)
Unable to import 'stuff.modules' pylint(import-error)

My stuff-module is located at /home/abb, so I tried to add both PYTHONPATH="/home/abb" and PYTHONPATH="/home/abb/stuff" to an .env-file, but since it still gives the errors, I think the problem is that I'm also using the stuff-folder as my workspace.

I don't think it's a problem with the .env-file, since I'm also importing from my lib-module located in the same folder as stuff, and this doesn't raise any errors.

(Oh, and if it is important, I'm running this on an SSH-connection)

2 Answers 2

1

I had a similar issue. I did 'fix' it by faking another path by using ProjectRootFolder.stuff.modules, saving, and typing again stuff.modules.

I know that it was not a real fix, but from then it worked, also it is stands ever marked with a red under-line.

I explained my issue here.

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

Comments

0

I had to edit python.analysis.extraPaths.

I tried the .env route and could not get it to work. I actually spent a couple hours on it.

If you go file->preferences->settings or ctrl+, you can search for "extrapath".

Just add your /home/abb/stuff there and it should work.

Comments

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.