mm_857
mm_857

Reputation: 171

Using local Python environment in IntelliJ

I've checked out a python project with a local environment. I am trying to add the local env in IntelliJ on the Project Structure > Platform Settings > SDKs screen, I select 'Add local' and navigate to [my_project]/env/bin/python.

I then see the message "Invalid Python SDK - Cannot set up a python SDK at Unknown at '[my_project]/env/bin/python'. The SDK seems invalid."

If I then click ok, I see the message "Cannot Detect SDK Version - Probably SDK installed in '[my_project]/env/bin/python' is corrupt"

In the logs I see the messages "ERROR - ns.python.sdk.PythonSdkUpdater - Failed to determine Python's sys.path value" and "...env/bin/python: cannot execute binary file".

Any advice would be much appreciated.

Upvotes: 2

Views: 772

Answers (1)

mm_857
mm_857

Reputation: 171

I found the answer, and including it here for completion even though it's a kind of specific case.

I have a project shared between a docker instance and my local machine. The 'env' I was trying to use on the local machine had been created in docker, and therefore referred to an instance of python that existed on docker.

I had to create a second environment on my machine, and now all is working well.

Upvotes: 1

Related Questions