1

I have been using Spyder IDE available in Anaconda's distribution. For some reason it just would not start I did a couple of uninstalls and reinstalls, tried starting it from command prompt but to no avail. I am running Windows 8.1 64 bit. I tried installing WinPython-64bit- 2.7. When I try starting spyder from the command prompt i face this error.

C:\WinPython-64bit-2.7.10.2\python-2.7.10.amd64>spyder.exe
Splitting and Joining Strings
Traceback (most recent call last):
  File "C:\WinPython-64bit-2.7.10.2\python-2.7.10.amd64\lib\runpy.py", line 162,
 in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\WinPython-64bit-2.7.10.2\python-2.7.10.amd64\lib\runpy.py", line 72,
in _run_code
    exec code in run_globals
  File "C:\WinPython-64bit-2.7.10.2\python-2.7.10.amd64\Scripts\spyder.exe\__mai
n__.py", line 5, in <module>
  File "C:\WinPython-64bit-2.7.10.2\python-2.7.10.amd64\lib\site-packages\spyder
lib\start_app.py", line 11, in <module>
    from spyderlib.cli_options import get_options
  File "C:\WinPython-64bit-2.7.10.2\python-2.7.10.amd64\lib\site-packages\spyder
lib\cli_options.py", line 7, in <module>
    import optparse
  File "C:\WinPython-64bit-2.7.10.2\python-2.7.10.amd64\lib\optparse.py", line 7
7, in <module>
    import textwrap
  File "C:\WinPython-64bit-2.7.10.2\python-2.7.10.amd64\lib\textwrap.py", line 4
0, in <module>
    class TextWrapper:
  File "C:\WinPython-64bit-2.7.10.2\python-2.7.10.amd64\lib\textwrap.py", line 8
2, in TextWrapper
    whitespace_trans = string.maketrans(_whitespace, ' ' * len(_whitespace))
AttributeError: 'module' object has no attribute 'maketrans'


I got Spyder working thru Python(x,y) but when I try to run any script i get an error message in the console

Splitting and Joining Strings
'import sitecustomize' failed; use -v for traceback
Traceback (most recent call last):
  File "D:\USC\RA\JSON to CSV\GP_apps_SQL-4 Sentiments.py", line 15, in <module>
    import urllib2
  File "C:\Python27\lib\urllib2.py", line 94, in <module>
    import httplib
  File "C:\Python27\lib\httplib.py", line 1241, in <module>
    import ssl
  File "C:\Python27\lib\ssl.py", line 90, in <module>
    import textwrap
  File "C:\Python27\lib\textwrap.py", line 40, in <module>
    class TextWrapper:
  File "C:\Python27\lib\textwrap.py", line 82, in TextWrapper
    whitespace_trans = string.maketrans(_whitespace, ' ' * len(_whitespace))
AttributeError: 'module' object has no attribute 'maketrans'
strpeter
  • 2,562
  • 3
  • 27
  • 48
aamir23
  • 1,143
  • 15
  • 23
  • You might want to check out [this question](http://stackoverflow.com/questions/6628306/attributeerror-module-object-has-no-attribute-maketrans) – iLoveTux Oct 14 '15 at 07:33
  • @iLoveTux I did read that it did not help it just gives me an error that string doesnt have maketrans – aamir23 Oct 14 '15 at 07:37
  • hmm, Everything else out there seems to be caused by something on the users path interfering with python standard library imports. What does `sys.path` contain when checked from Anaconda's Python? – iLoveTux Oct 14 '15 at 07:45
  • See the solution here http://stackoverflow.com/questions/36337059/can-no-longer-open-spyder-ide-for-python-programming/39497268#39497268 – Jim Sep 14 '16 at 18:39

1 Answers1

1

For the Winpython part, you may try this:

click on "Winpython Command Prompt"

type:

spyder --reset&&spyder

(may take up to two minutes, depending of your computer)

stonebig
  • 1,193
  • 1
  • 9
  • 13
  • I'm using Spyder 3.2.8 for Python 3.6 on Win10, and now there is a `Spyder reset.exe` file in the WinPython directory that fixed the problem along these lines. – Aaron Bramson Jul 17 '19 at 05:05