1

I am a complete newbie to Python. I have downloaded and installed Anaconda 3.5.2 on Windows 7, then Eclipse Photon. Installed the PyDev Plugin. I was able to run a few simple test programs in Eclipse.

Suddenly, without installing anything I get

Error processing line 1 of C:\Anaconda3\lib\site-packages\matplotlib-2.2.2-py3.6-nspkg.pth:

Failed to import the site module
Traceback (most recent call last):
  File "C:\Anaconda3\lib\site.py", line 168, in addpackage
    exec(line)
  File "<string>", line 1, in <module>
  File "C:\Anaconda3\lib\types.py", line 171, in <module>
    import functools as _functools
  File "C:\Anaconda3\lib\functools.py", line 21, in <module>
    from collections import namedtuple
ImportError: cannot import name 'namedtuple'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Anaconda3\lib\site.py", line 541, in <module>
    main()
  File "C:\Anaconda3\lib\site.py", line 523, in main
    known_paths = addsitepackages(known_paths)
  File "C:\Anaconda3\lib\site.py", line 320, in addsitepackages
    addsitedir(sitedir, known_paths)
  File "C:\Anaconda3\lib\site.py", line 207, in addsitedir
    addpackage(sitedir, name, known_paths)
  File "C:\Anaconda3\lib\site.py", line 178, in addpackage
    import traceback
  File "C:\Anaconda3\lib\traceback.py", line 5, in <module>
    import linecache
  File "C:\Anaconda3\lib\linecache.py", line 8, in <module>
    import functools
  File "C:\Anaconda3\lib\functools.py", line 21, in <module>
    from collections import namedtuple
ImportError: cannot import name 'namedtuple'

even with a "Hello World" which ran before

Any ideas what could cause this?

2 Answers 2

1

I have found the reason: I have added a "PyDev Package" named "collections" in the IDE. This collided with something ....

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

1 Comment

A good motivation to explore the Python module collections And you can and should accept your own answer, if it solved your problem.
0

You can try a few things. Have you tried updating the package in conda? It is possible it is not up to date. Also, with Eclipse (and with most IDEs) if things that were working a moment break without any changes it is a sign you should quit the program, give it a moment to settle, and try reopening and rerunning your code. Sometimes it is the tool's fault!

3 Comments

Thanks for your answer.
I have restarted Eclipse, and even rebooted. Still the same error. How can I update the package (with Anaconda Navigator ?)
From the anaconda prompt run "conda update <package>"

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.