0

I'm trying to run a Python code that imports Numpy. However, everytime I tried to do it, it shown

Error importing numpy: you should not try to import numpy from its source directory;
please exit the numpy source tree, and relaunch your python interpreter from there.

Then I removed the Numpy directory with

sys.path.remove(\...)

and to restart the Python shell. Now It still shows the same error message and when I try to use sys.path commands, it prints

NameError: name 'sys' is not defined

Can somebody help me?

4

2 回答 2

0

NameError:名称“sys”未定义

要解决这个问题,您需要在使用它调用任何函数之前“导入 sys”。

于 2016-01-04T18:07:09.720 回答
0

我发现我必须只写import sys:)

于 2016-01-04T18:23:45.107 回答