Spyder unexpectedly froze and I turned off my PC (as in, pulled out the power cord). Now I cannot open Spyder, and I get this error when try to do so:
There is no documentation online for this, and I don't understand what it means. Please help.
There are two possibilities:
Run the 'Reset Spyder settings' program and restart your PC
Do a clean reinstall of Spyder
You can delete the .spyder directory from your home directory. If you run spyder with Python 3, this would be the .spyder-py3 directory.
(The spyder user settings directory is probably corrupted)
Related
I am running a Cryptocurrency-trading python program on my laptop
It monitors the market every second and when the condition is satisfied, it tries transactions.
When I run it on windows CMD, it causes many problems below.
1. Sometimes, it halts till I click the cmd window and press 'enter' key
2. Sometimes, it causes many unknown errors.
However, when I run that on VScode, it does not cause any problem.
I wonder what makes the difference between those two environments.
I have had some issues with VSCode not finding libraries and similar, and the reason for that is that VSCode runs its own python. In IDLE (and CMD) you run the raw python in AppData, but VSCode runs an executable they have downloaded via extensions through the program files folder.
My hypothesis is that Python as in the AppData folder is corrupted or wrong in some way, but the Program Files folder is correct. It may even be on a different python version.
Try reinstalling python from the official python website, and run it again. Also double-check that the VSCode Python extension version is the same as the one saved in "C:\Users\YOURUSERNAME\AppData\Local\Programs\Python\Python39".
Hope it worked!
I am trying to install Python 2.7 (64 bit) on Windows 10. In the middle of the installation, a window pops up saying:
Error writing to file C:\Python27\pythonw.exe. Verify that you have
access to that directory
How can I resolve this issue and install Python?
This error is normally encountered when the installer does not have admin rights for the drive/folder you are installing to. I also noticed that you are installing to drive C:
Here are a couple of things for you to try.
Open the installer program by right-clicking, and then selecting "Run as Administrator".
Depending on how you have your PC set up you may not have permission to install on drive C:
If this is a work computer, talk to your IT department. Otherwise, seriously consider using different drives to keep your OS and your applications separated.
I encountered a similar issue while installing Python 2.7.11 on Windows 7 (64bit). Here is how I solved the error.
Note down the path mentioned in the error.
Do not close the error message. i.e. Do not press "Retry" or "Cancel", let it be there.
Go to the directory mentioned in step-1.
Try to create a new folder or text file in this directory.
You will get an error message saying "The Disc Structure is Corrupted and Unreadable". This is the real issue which is causing the Python installation to fail.
Run Command Prompt as an administrator and enter the command: Chkdsk \f C:
Either it will start checking the disc or it will ask you to select if you want to check disc next time you boot-up your machine. Select Yes and restart your machine.
A disc check will be performed, which may take 5-10 minutes.
Now you can install Python without any issue.
I had the same problem , this is how I solved the error :
click on cancel
go to c:\
create a new folder and call it python or python3
run the python install as administrator and choose the new folder that you just created
as directory where it should be installed
et voila !
Your Windows 10 version may not be activated. So many administrator features are locked in inactivated Windows10 version.
So try to open CMD in administrator mode and run following command to ignore the activation message.
slmgr -rearm
Now you can install fresh version of python with pythonw.exe features.
Right Click The running Uninstaller. Then Right Click Python 3.9.1 64-bit as shown below in the picture. ( I have Python 3.9.1. You can do it in any Uninstaller) Now it will repair without any errors. ^_^
I've been studying Python for a month now and normally I run all my programs in Sublime Text 3.
Today I learn to run Python programs in the terminal window as introduced in this section of the Automate the Boring Stuff with Python book following this video. Basically, I followed the instruction in the video and created the hello.py file as below:
#! python3
print('Hello, World!')
Then I opened the Command Prompt to run the file with the command: py.exe c:\users\danh\mypythonscripts\hello.py,
an error pops-up and states that "This app can't run on your PC" and a line says that Access is denied. I spent the whole day trying to fix this problem but still I couldn't get it running.
One thing is when I change the directory of the Command Prompt to run the file to C:Windows\system32 (or run the Command Prompt as Administrator) and then run the command py.exe c:\users\danh\mypythonscripts\hello.py, it runs the file without any problem as in this image.
Does anyone know how to fix this problem? Any help is appreciated. Thanks!
I solved the problem.
When I looked into my user directory at C:\Users\<Username>, it appears that there is a py.exe file that has 0 bytes.
I was told in this thread that the py.exe file shouldn't be in my user directory so I removed that file and it fixed the problem.
I still don't know how the py.exe file got into my user directory and why it has 0 bytes so I'm not sure this solution could help others. For now, I will accept my own answer because it solves the problem in my case.
It looks like you're trying to use Microsoft's new Windows 10 Metro-based auto-installing version of Python. It's included by default but, as you've found, it doesn't work very well.
Try installing the version from the Python website.
If you've got a 32-bit copy of Windows, make sure to install the 32-bit version; Windows isn't very good at running 64-bit programs from a 32-bit kernel. You can check by looking in your C: drive; if you haven't got a Program Files (x86) folder, install the 32-bit version.
python.exe inside my env\Scripts\ became 0kb for some reason. So I created another virtual-env and copied python.exe from there to this folder. then it started working.
I am getting a red message every time I use the console from the debugger and try to see the output of a pandas object
"tput: terminal attributes: No such device or address"
I am using PyCharm 2016.3.2 and according to me I didn't update anything - it just started to appear all of a sudden. I attach a screenshot of the debugger with info on my ipython and debugger versions. Would appreciate your help to understand how to get rid of this message. It seems to appear both in the Python Console and Debugger Console, but not in the PyCharm Terminal. Thanks.
There is a workaround inside PyCharm itself without affecting the rest of the system:
You can hard code PATH as part of Environment set up under this menu:
Click menu Run -> Edit/Configurations...
when the configuration window opens, click on Defaults -> Python.
On the right side under Environment Variables hard code PATH without git/cygwin. See below how to get that path from cmd prompt
import os, re; print ';'.join([p for p in os.getenv('PATH').split(';')
if not re.search('Git', p)])
This PATH variable seems to overwrite system's path variable.
Image of these steps overlaid in PyCharm.
Another workaround is to simply move tput to a different cygwin PATH directory,
e.g. if tput is in ~/git-for-windows/usr/bin, and the same directory is in the windows PATH, moving tput.exe to ~/git-for-windows/usr/local/bin will fix the issue in pycharm and still work within cygwin
Have you installed git or cygwin recently? If so, try to delete git or cygwin related paths from system environment variable PATH. If had the same problem as you and now have fixed it by doing so.
Just to complement the answer from H.J. Liu, if you are unable to delete cygwin from the system PATH, then it is probably in the user PATH. Please see this related post Unable to remove cygwin from PATH environment variable
additional for Anaconda2 Users, you will find tput.exe in following two path:
Anaconda2\Library\usr\bin
Anaconda2\pkgs\git-xxx\Library\usr\bin
mv them to xxx\usr\local\bin
My colleague had the same error. It occurred only for pandas.
We resolved it by changing the project interpreter in PyCharm to the anaconda one, where he previously set up everything else. If for example, you use Anaconda navigator, then all the tput paths are set up there. (Maybe the settings got lost when downloading a new PyCharm version.)
I'm sharing this to give people some more ideas where to look for, not to get too focussed on cygwin.
I always ran my scripts on windows by double-clicking them. However after I reinstalled my python versions this is not happenning. My python installations are on C:\Python27 and C:\Python33. PATH has C:\Python27\ in it. If I try to run a script from cmd, it works ok. But when I double-click any .py file nothing happens.
I am completely clueless as I don't use windows often for scripting.
What can be the reason for that?
Steps to cure this problem
1) Right click on your script.
2) Choose properties and then
3) Change the option how to open your script (set it as python).
This will make all of your .py extension scripts into running on double click in windows
Double-clicking is not related to PATH, but extension association.
Check register extension option when you install(or recover) the python.
Removed all python versions and folders. Installed WinPython-64bit-2.7.5.1 package (as before) and everything works now. I can run my scripts by double-clicking them. Really strange.
I was having the same issue. The code works in the IDLE but not on double click. I ran the script through the command prompt and it gave me an error that the IDLE didn't find. Windows didn't like the ascii characters I was printing. I removed them and the script started to work on double click again.