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

Spyder crashes on Windows because of non-ascii chars in working directory #2081

Closed
spyder-bot opened this issue Feb 17, 2015 · 13 comments · Fixed by #2219
Closed

Spyder crashes on Windows because of non-ascii chars in working directory #2081

spyder-bot opened this issue Feb 17, 2015 · 13 comments · Fixed by #2219

Comments

@spyder-bot
Copy link
Collaborator

From fausto.b...@gmail.com on 2014-12-10T12:23:51Z

Please note that reporting bugs from Spyder's help menu ("?" > "Report
issue...") will fill version details for Spyder, Python and Qt in this description for you.

What steps will reproduce the problem?

  1. I simply run Spyder from its shortcut 2. 3.

What is the expected output? What do you see instead?

Instead of Spyder I get the attached crash window (PNG file). When I close it, Windows tells me that "pythonw.exe has stopped working" and offers to check online for a solution or to close the program. What version of the product are you using? On what operating system? Windows 7-64, Python 2.7.8-64, Spyder 2.3.2

Please provide any additional information below

. The crash window advises me to run "python spyder --reset". If I do that Spyder works for a while, but minimal changes in its Preferences make it crash again.

If I try to reinstall Spyder from the installer it says that Python 2.7 couldn't be found in the Registry, but it is there because Python works in interactive mode.

Attachment: spyder.png

Original issue: http://code.google.com/p/spyderlib/issues/detail?id=2081

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2014-12-12T13:46:19Z

Couple of questions:

  1. What are the changes you try to do in Preferences before Spyder crashes again?
  2. Are you using a Windows account with non-ascii characters? like á, é or something like that?

Labels: MS-v2.3.3 Cat-Settings

@spyder-bot
Copy link
Collaborator Author

From fausto.b...@gmail.com on 2014-12-15T05:13:53Z

Hello CCordoba12,

Answers to your questions:

  1. Simple things such as changing the the folder where Spyder should point to by default to find source files.
  2. Even though I use special characters (Brazilian Portuguese keyboard with special characters like á, é, etc) the /account/ I use has none of those. It's called "fausto", simple like that. My scripts usually don't have special characters, either (I avoid them).

I've been happily using Spyder in my work (Windows machine) and home (Ubuntu) over the last year, simply love it, it beats other IDEs hands down, but I've gotten this issue lately. Don't know what to do, because nothing has changed on my system. This is a Windows-only issue I'm afraid. At home, where I run Ubuntu, Spyder is working beautifully as ever.

Thanks for your reply.

Fausto

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2014-12-15T09:13:08Z

Thanks for the answers Fausto and I'm glad to hear you're enjoying Spyder.

Could you please describe exactly what preference are you changing and post here the directory name you are using for source files?

I think this problem is related to some difficulties we have to handle option values with non-ascii characters in Python 2. Our Python 3 version should work without problems though :-)

@spyder-bot
Copy link
Collaborator Author

From fausto.b...@gmail.com on 2014-12-15T10:24:26Z

Hello,

I observed that the crash usually happens after I try to change:

Tools/Preferences/Global working directory/Startup/the following directory:

and

Tools/Preferences/Run/Working directory/the following directory:

But those may not be the root of the actual problem, it's just my guess. I simply observed that Spyder crashed a couple of times after my trying to tweak those values.

The non-ascii characters may not be the ones to blame, either. My computer, keyboard, regional language configuration, etc, etc, have always been the same since I installed Spyder for the 1st time. Why only now it began to crash?

If there's any other log/config file I might send, please let me know.

As for Python 3, I for one would like to keep using Python 2.7. Will that be possible with the new version? Maybe the time to move to another IDE has come
(but I will certainly keep using Spyder on Ubuntu).

Fausto

@spyder-bot
Copy link
Collaborator Author

From dan.mcc...@gmail.com on 2014-12-19T19:30:57Z

I just installed spyder on windows too (normally use Linux) and here is how I solved this issue:

  1. The crash (in my case) was an unmet dependency for jinja2. I'm using miniconda, so "conda install jinja2" got the dependency met (though pip should also work)
  2. the start menu shortcuts that were getting created by "conda install spyder" were creating two problems: (a) the path name in the shortcut had a forward slash instead of backward slash just before the filename (the rest of the path was correct), and (b) it was trying to start spyder in $DOCUMENTS/Python scripts, which is a directory that doesn't exist (and in my case, resides on a different drive than C:/, which can also sometimes cause problems). I suggest starting it in C:/Users/$USER

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2015-01-01T14:30:21Z

Thanks @-Dan for the solution but I think the problem is a bit different in this case.

@-Fausto Spyder will continue to work with Python 2 and 3 for the foreseeable future. This is just a bug.

Summary: Spyder crashes on Windows because of non-ascii chars in working directory (was: Spyder crashes on start-up.)

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2015-01-10T11:11:10Z

I can't reproduce this error, sorry.

@-Fausto: could you try to start Spyder from a terminal (i.e. cmd.exe) and post here the error you see there? Thanks

Labels: -MS-v2.3.3 MS-v2.3.4

@vasily-smirnov
Copy link
Contributor

I have nearly the same issue (Anaconda 2.1 distribution, Windows 7 32 bit, Python 2.7.4, Spyder 2.3.1).
The user name on my PC and thus HOMEPATH directory both contain non-ascii characters (Russian).
This caused issues with python itself in Anaconda which I could workaround.
However, when I start Spyder from cmd.exe (or in any other way), the splash window appears and soon (after 1-2 sec) Spyder crashes, cmd.exe window is closed, I don't see any errors reported.
I can change user name at home, but for my university PCs this is not an option.
spyder --reset doesn't help.

I found a workaround: unset HOMEPATH and USERPROFILE environment variables and launch spyder. My .bat file looks like this:
set HOMEPATH=
set USERPROFILE=
C:\Anaconda\Scripts\spyder.exe

After looking at the code I have identified several changes to both Anaconda distribution and Spyder which make it launch fine. However, I'm not sure that my changes are compatible with other environments.

I have created a patch py(w) with Tkinter GUI which does the job. I also could bundle it into exe via py2exe and compress to single self-extracting exe via WinRAR to be 100% independent of python issues.

py(w) file is here:
http://almalabs.ru/os/wp-content/uploads/2015/03/patch-Anaconda-2.1.0-Windows-gui-en.pyw

exe file is here:
http://almalabs.ru/os/wp-content/uploads/2015/03/patch-Anaconda-2.1.0-Windows-gui-en.sfx.exe

@ccordoba12
Copy link
Member

@vasily-smirnov thanks for your interest in helping us solve this problem. Your patch seems to touch parts of the Python os module, that we really can't touch.

Is it possible for you to try to come up with a solution that only touches Spyder code? Also, please open a pull request for this :-)

@vasily-smirnov
Copy link
Contributor

Ok, thanks for the input regarding os module.
I will open a pull request for spyderlib\userconfig.py only - the changes seem failsafe and worth doing.

@ccordoba12
Copy link
Member

Thanks a lot Vasily! Really waiting for it :-)

El 02/03/15 a las 02:31, vasily-smirnov escribió:

Ok, thanks for the input regarding os module.
I will open a pull request for spyderlib\userconfig.py only - the
changes seem failsafe and worth doing.


Reply to this email directly or view it on GitHub
#2081 (comment).

@vasily-smirnov
Copy link
Contributor

I submitted a pull request, however because I use github for the first time, please confirm that you received it and I did it ok.

@vasily-smirnov
Copy link
Contributor

The first change was failing in case Spyder config INI did not exist. I fixed it in the second commit

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

Successfully merging a pull request may close this issue.

3 participants