Home > database >  unable to import "numpy" or pandas using python3 or python commandline, but able to import
unable to import "numpy" or pandas using python3 or python commandline, but able to import

Time:09-27

In jupyter notebook server, importing numpy or pandas is okay. pic

However, by using python3 or python in commandline, I am not able to import anything because of a package named SystemRandom. pic2

Can anyone give me some suggestions?

Much Appreciated!

CodePudding user response:

You have a file random.py on your Users folder ("/Users/chenyao/random.py") this file is interfering with the numpy import. You have two options:

  • rename the file
  • change directory

CodePudding user response:

It tries to import SystemRandom from /Users/chenyao/random.py. Remove or rename that file and it should work.

  • Related