I am using PyCharm Community Edition and tried versions 2019.1.3 and 2019.1.2. I can create a new project and files to that project but as soon as I write anything (e.g: in a .py file, in a .html file or even entering the script path when adding a configuration) it crashes (also crashes when trying to edit an already existing project). Any suggestions what I can do to fix that?
Go to Preferences/Appearance and select a different font, I used "Monospace" and things seem to work again.
On my system, PyCharm was crashing when it called into CoreText rendering. Reinstalling and trashing preferences otherwise didn't work.
Related
Is there a way to make the .py option appear in the VS Code New File Menu? It used to appear when having the Python extension installed, however, something changed.
It is useless, just type name_file.py and press enter.
Although the .py option never appeared on my machine, I've seen this problem several times. According to this question, maybe downgrading the vscode version can solve the problem.
My suggestion is to add the following configuration to settings,json so your vscode will default each new file to a python file.
"files.defaultLanguage": "python"
Issue
So, I've used PyCharm for quite a while and I know how to set environments, etc. For some reason, I can't seem to access the Python interpreters that I've got (see image).
When I open the same project in Clion I am able to run the files and I can see the interpreters.
Attempted solutions
Run in Clion to see if the interpreter "sticks".
Removed the .idea file.
Reinstalled PyCharm.
Usually Python Interpreter is a sub-item of Build, Execution, Deployment in the Settings. (In PyCharm 2021, the layout in PyCharm 2019 was slightly different).
The fact the item appears separately is a strong hint that you either installed a plugin or for some reason the IDE was opened in LigthEdit mode (this can easily happen if you launch the IDE using the command-line). This can also happen if you don't have an open project (having files open is not the same as opening a project, as such, with an .idea folder - the IDE configuration files will be different.)
Having the IDE in LightEdit mode provides only a limited set of functionalities, so the IDE doesn't allow you to configure an Interpreter in the usual way (other setting dialogues will also behave different from usual).
The solution is to Exit the LightEdit mode, opening your previous project or a new one by going to File > Open or File > New Project.
I just uninstalled and reinstalled python on my Windows machine. Before I uninstalled my previous version I was able to just double-click on a python script and it would open the command prompt, run the script, and close automatically. After re-installing with the newest version (3.9), I am no longer able to execute the script like that with a double-click.
Clearly I had done something special last time to set that up for myself, but I don't remember what it was. Any idea how I can get that double-click deal going again?
Doing the following should fix it:
Right click on the .py file you want to open;
Open with -> Choose default program -> More options;
Select the python.exe file.
Explanation:
Your Python scripts have to be processed by another program called the Python interpreter. The interpreter reads your script, compiles it into bytecodes, and then executes the bytecodes to run your program.
Installing a new version might have messed the path to the Python interpreter. The steps listed above will tell Windows to associate .py files with your Python interpreter, thus fixing the issue.
This link with Python on Windows FAQ might also be of help.
There will be an option of "Open With" after right-click on the file go and choose CMD. I hope it helps if not then sorry. Because I use Parrot OS
Save the following text to a file called something like python.reg (the .reg extension is important). You might need to modify the last line to be your exact path to python.exe!
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Python.File\shell\open]
[HKEY_CLASSES_ROOT\Python.File\shell\open\command]
#="\"C:\\Python2.7\\python.exe\" \"%1\" %*"
Find the python.reg file you just saved and double-click it to load those contents into your Registry. If you've performed one of the other operations in other answers (like "Open With"), those "UserChoice" settings are stored somewhere else in the Registry and will override the "Classes" setting shown in this script. So, do one or the other, don't combine them!
Even after looking through numerous topics about this matter, I have been unable to find a solution for my predicament.
I have recently downloaded Anaconda navigator v.1.7.0 from which I can use Spyder v3.2.6 has an IDE. I would like to open .py scripts from file explorer with Spyder has default, but when I go in ‘open with’ and click on spyder.exe in C:\Anaconda\Scripts, all I get is a black console window that closes instantaneously. Can anybody help me out on this matter?
I note that I can drag and drop .py files on the Spyder console directly, but has previously mentioned by other users, this feels a little awkward and cumbersome.
From How to get Spyder to open python scripts (.py files) directly from Widows Explorer, I have tried manipulating the spyder-script.py in regedit but to no avail.
This is a similar issue but doesn’t seem pertinent for the current case: WinPython Cannot run .py files directly (without spyder)
These two threads precisely discuss about what I’m trying to do:
How to read a .py file after I install Anaconda? But no good answer
Set Spyder as default Python and there are comments that talk about creating a spyder.dat file, but I have no idea on how to do this and I can’t find any proper documentation on it.
I also took a look at this: https://github.com/spyder-ide/spyder/issues/466 and this https://github.com/spyder-ide/spyder/issues/971 but I can’t make sense of the exchanges
Could the answer be with the spyder.dat file? Or maybe with something else? That's what I'd like to know.
Cheers
I've been testing out PyCharm but ran into a crazy little feature and or bug and cannot figure out how to solve it.
I've created a project on a network, and created a project locally and added a network folder to the project both are resulting in the same bizarre behavior.
I can open files, navigate the project tree and everything is fine inside of PyCharm. But once I switch focus to another window and then come back to PyCharm, it will automatically close the entire project tree back to the root and close any files I have had open.
This is certainly making PyCharm completely unusable. I've been searching most of the morning to find out how to stop this but haven't even come across any other similar problems.
To test, I made a sample Python directory on the network, filled it with a few folders to simulate modules and added init.py files to them all. Then created a PyCharm project in the folder. It will exhibit this behavior and I can't figure out how to stop it from closing everything. What's going on?
This is Windows Community PyCharm 2017.2.1 Version. A picture would just be everything open and then everything closed and the tree view, since it closes everything when it regains focus. I'm not sure how I'd best take a picture of that.
There is an open bug filed in PyCharm for this issue which is yet to be fixed : https://youtrack.jetbrains.com/issue/IDEA-171352
Description of the bug mentions :
I didn't observe the problem with PyCharm 2016.3.3.
PY-171.3780.115, JRE 1.8.0_112-release-736-b13x64 JetBrains s.r.o, OS
Windows 10(amd64) v10.0 , screens 2560x1440, 1920x1080, 1080x1920
Apparently the issue is in later releases of PyCharm