MechEInventor
MechEInventor

Reputation: 11

Spyder not recognizing pip install of package (Networkx)

I am pretty new to Spyder, so lets start by assuming that I know nothing. I want to install a package library called Networkx, but I am having troubles getting Spyder to realize that. I installed the latest version of Spyder today. I also installed the latest version of Python (3.9). I then attempted the package install using pip install networkx (pip comes with Python 3.9). This seemed to work in the sense that networkx install showed a completion message. However, Spyder still doesn't recognize that I installed the package. What am I doing wrong? The error I get from Spyder is below:

Traceback (most recent call last):

File "C:\Users\User.spyder-py3\Networkx Testing File.py", line 1, in import networkx as nx

ModuleNotFoundError: No module named 'networkx'

I found the following discussion on GitHub that seems like it answers the question, but I'm not sure how to implement this person's solutions:

https://github.com/spyder-ide/spyder/wiki/Working-with-packages-and-environments-in-Spyder#installing-packages-into-the-same-environment-as-spyder

Upvotes: 1

Views: 1359

Answers (1)

Joost van den Assum
Joost van den Assum

Reputation: 11

I encoutered this problem as well.

I do not know why, but I got networkx to work if you open Spyder through Anaconda, instead of using the stand-alone version of Spyder.

Upvotes: 0

Related Questions