Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError while importing (path must be None or a list) #5121

Closed
skjerns opened this issue Sep 4, 2017 · 8 comments
Closed

RuntimeError while importing (path must be None or a list) #5121

skjerns opened this issue Sep 4, 2017 · 8 comments

Comments

@skjerns
Copy link
Contributor

skjerns commented Sep 4, 2017

Description of your problem

What steps will reproduce the problem?

  1. Install newest version of Anaconda (Python 3.6).
  2. conda update conda & conda update spyder
  3. pip install telegram_send
  4. Start spyder and import telegram_send
Traceback (most recent call last):
  File "<ipython-input-1-4a435a0249ac>", line 1, in <module>
    import telegram_send
  File "C:\Anaconda3\lib\site-packages\telegram_send.py", line 28, in <module>
    import telegram
  File "C:\Anaconda3\lib\site-packages\telegram\__init__.py", line 94, in <module>
    from .bot import Bot
  File "C:\Anaconda3\lib\site-packages\telegram\bot.py", line 34, in <module>
    from telegram.utils.request import Request
  File "C:\Anaconda3\lib\site-packages\telegram\utils\request.py", line 34, in <module>
    import telegram.vendor.ptb_urllib3.urllib3.contrib.appengine as appengine
  File "C:\Anaconda3\lib\site-packages\telegram\vendor\ptb_urllib3\urllib3\contrib\appengine.py", line 63, in <module>
    from google.appengine.api import urlfetch
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 946, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 881, in _find_spec
  File "<frozen importlib._bootstrap>", line 855, in _find_spec_legacy

  File "C:\Anaconda3\lib\site-packages\pyximport\pyximport.py", line 254, in find_module
    fp, pathname, (ext,mode,ty) = imp.find_module(fullname,package_path)

  File "C:\Anaconda3\lib\imp.py", line 270, in find_module
    "not {}".format(type(path)))

RuntimeError: 'path' must be None or a list, not <class '_frozen_importlib_external._NamespacePath'>

This works fine in the regular python or iPython console.

Version and main components

  • Spyder Version: 3.2.1
  • Python Version: 3.6.1
  • Qt Versions: 5.6.2, PyQt5 5.6 on Windows

Dependencies

pyflakes >=0.6.0 :  1.5.0 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pygments >=2.0   :  2.2.0 (OK)
pandas >=0.13.1  :  0.20.1 (OK)
numpy >=1.7      :  1.12.1 (OK)
sphinx >=0.6.6   :  1.5.6 (OK)
rope >=0.9.4     :  0.9.4-1 (OK)
jedi >=0.9.0     :  0.10.2 (OK)
nbconvert >=4.0  :  5.1.1 (OK)
sympy >=0.7.3    :  1.0 (OK)
cython >=0.21    :  0.25.2 (OK)
qtconsole >=4.2.0:  4.3.0 (OK)
IPython >=4.0    :  5.3.0 (OK)
pylint >=0.25    :  1.6.4 (OK)
@ccordoba12
Copy link
Member

There's not a single line related to Spyder code in your error report. Sorry, but I fail to see how this can be solved in our side.

@skjerns
Copy link
Contributor Author

skjerns commented Sep 4, 2017

But why does this error only appear when using Spyder and not within a regular iPython console?

@ccordoba12
Copy link
Member

I really don't know, but unfortunately we don't have time to help you to debug this.

@jegehrin
Copy link

I have a similar issue with the pyART library. @skjerns : did you solve your problem? If yes, how?

@ccordoba12
Copy link
Member

This is a duplicate of issue #5299. There's a workaround in that issue that you need to apply before we solve it for good.

@woaichipinngguo
Copy link

I have same problem when I import tensorflow.contrib.slim as slim with spyder, but it is ok in Jupyter or cmd window. How can I solve it? @ccordoba12 Did you solve your problem? @jegehrin @skjerns

@ccordoba12
Copy link
Member

This is a duplicate of issue #5299. Please see that issue for a temporary fix.

@selahlynch
Copy link

selahlynch commented Feb 28, 2018

Direct link to solution in #5299:
https://stackoverflow.com/questions/46422488/get-rid-of-pyximport
For the anaconda users out there, I found my sitecustomize.py file with the following command...
find ~/anaconda3 -name 'sitecustomize.py'
I then quit and restarted both Anaconda and Spyder and it worked.
PS. Long live Spyder!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants