I recently upgraded to Python 2.7.10 on MacOSX Yosemite. I also added a Python 3.4.3 installation. At the time I upgraded Tcl/Tk with ActiveTcl 8.5.18 as was suggested on the Python for MacOSX installation page. There is also an ActiveTcl 8.6 package from last year that still shows up in the framework, but I was pretty sure that I said to delete that when I went back to an earlier version of 8.5. Path has settings for all three as well as usr/bin, etc.
At this point, Autocomplete and Call Tips stopped popping up. I checked the preferences and it seemed to be turned on. The delay was set to 2000, so I changed that to 2, but nothing happened. Pressing {ctrl}-Spacebar and then using the down arrow key lets me cycle through the the available functions, but putting a dot after an object has no effect, and if I open parentheses, I get no tips. This is both in the IDLE Shell and Editor windows.
I tried to redo everything by deleting all instances of Python from my drive. I reinstalled them, reloaded all packages, and Autocomplete and Call Tips still are not popping up. Is there any known issues or is there a workaround? Do I possibly need to add or change the new Tk path somewhere so that IDLE can find what it needs to popup autocomplete? Is there a way that I can initiate IDLE Autocomplete and Call Tips during the coding session to manually get them to work?
I have also raised this with ActiveState and Python, but I haven't gotten or found an answer yet that has gotten it to work. I like working with IDLE and would like to get Autocomplete and Call Tips up and running again.
Thank you.
Related
I'm using Pycharm (2019.1.2 x64) from quite a while and I never changed the standard settings.
The standard settings diplay keywords (def, class, if) in orange, pressing tab will auto complete the keyword and add a space, build-in functions (sum(), map(), print()) are displayed in purple and pressing tab will auto complete the function name, add brackets and move the cursor inside the brackets.
This is the desired behavior and it's what I get when opening any project in Pycharm except one.
In a single project this behavior suddently changed, I did nothing but writing and running code.
I noticed because tab suddently started indenting by 8 spaces instead of 4, no big deal I changed it back to 4 in the bottom of the IDE, but I also noticed that print was seen as a keyword (so orange with no brackets) instead as a built-in function, just like in Python2 (I never used it and the project's interpreter was Python 3.7). from __future__ import print_function would turn print into a function again but it's Python2 stuff.
I fixed it by creating a new virtual environment and setting up the interpreter again, so my question is:
What causes this unexpected behavior?
I would like to avoid this when working on my most "serious" projects. Thanks all.
NEW ANSWER
Well, this happened to me just yesterday while I was working on my tkinter project. It showed tkinter in from tkinter import * "Module not supported in Python 2.7", even though I was using Python 3.8.
Solution One
To fix this issue, I just simply went to
File > Settings > Appearance and Behavior > System Settings > Updates
And updated PyCharm to the latest one. It worked for me.
Solution Two
Another method I found out is to go to
Press Shift Key Twice > Typing "Restore Default Settings"
Doing this will also restore all the settings partially and fixes the problem for me.
Why Did This Happen?
This is due to a bug in older versions of PyCharm (probably). I got this bug while testing some Google API that was in Python 2.7. If you ever opened a project containing Python 2.7 Interpreter and opened another project that is in Python 3 and above, PyCharm thinks that the code that is written is in Python 2.7 and just formats the guide according to it. Some example can be "f" in print(f"{some_variable_here}") being shown as "Not Supported In Python 2.7". This is just my theory I may be completely wrong here.
OLD ANSWER
Are You Using macOS? if yes, macOS comes with Python 2 preinstalled. So probably this may be a bug. I suggest going to the bottom right corner and there would be written "Python (Version)". If it is something other than 3 or above (like 2), click on it, and go to "Interpreter Settings" and there, from the drop down menu, select the other Python interpreter that is installed on your device.
If this does not work, then it may be a theme bug, or something to do with PyCharm itself (probably). Reinstalling and clearing the cache should probably work.
I remember autocompletion to be working for me on PyCharm some time ago, but I just noticed that is no longer is. It doesn't work for basic python syntax as well as any libraries.
I've tried using the "Invalidate Caches and Restart" option in the File menu of PyCharm. I've also made sure that the Project Interpreter is using the Python in the venv of the project created by PyCharm. I've tried a handful of other things but these two are the most common solutions I've encountered and nothing is working. Note that hitting Ctr-Space anywhere just gives me a "No suggestions" message (not sure if this is relevant but thought I'd mention it).
Any ideas? Any help or ideas at all are appreciated.
I started getting this error every time I try to:
install Python package with installer
use PyWin extension (through COM application)
start Notepad++ (with Python script plugin)
This started to happen couple of days ago.
Dialog shows, I dismiss and everything runs fine, except it pops again and again
I reinstalled Python 2.7.3 on Windows XP SP3 32bit, then reinstalled PyWin extensions, but nothing changed.
Looking for answer here, I found that obviously some library is missing manifest declaration, but I can't figure which one. Or what is loaded by default in all above mentioned 3 scenarios. Does anyone maybe has an idea?
I found it - it's PyGTK. I installed it couple of days ago, and I did suspect on it, but wasn't sure and didn't wanted to mislead.
I renamed gtk-2.0 folder in site-packages and dialog stopped to show
Will contact the team and report back if I have something
Update
I tried to contact PyGTK team, couple of days ago, but the list seems very low frequency, I wonder who uses PyGTK on Windows. This is the link to reported problem in case anyone cares: http://www.daa.com.au/pipermail/pygtk/2012-November/020462.html
And in case anyone is curious what did I do with this error dialogs, here is answer: I used PyGTK as I needed it by one project, which I now compiled to executable and got rid of GTK from my Python packages.
If you know what application or library is failing to load, you can use Dependency Walker to show any missing dependencies.
I have had trouble setting up the pycharm ide on my macosx10.7 with python3..
I have scoured every resource available and tried hundreds of approaches, at this point I must accept my incompetence and seek help via this channel.
In my research, I notice a lack of ground-up explanations on python integration into macosx and how to configure pycharm to import modules, run code within the editor, etc. If i ever solve this I will make a very detailed tutorial.
I have imported python3 successfully, it looks like it is linked appropriately from /sys/lib/frameworks to /usr/lib ...etc -- version control is working just fine.
I think my issue is either in setting environmental variables (tried the program to fix this and tried macports) and in the script needed to execute. it will catch errors throughout but final product does not run in python and returns printout of :
/Library/Frameworks/Python.framework/Versions/3.2/bin/python3.2 /Users/anon/Desktop/pythonpractice/Py_Ex/classes.py
Process finished with exit code 0
i really need to get this configuration sound for my python programming class. please help (I've been through every line of pycharm website) .. preferably is there a way to map it via terminal? thanks for anyone who took the time to read this.
Summary of the discussion above:
Python 3.2.2 installation was broken on this Mac, installing ActiveState Python 3.2.2 from scratch and configuring it in PyCharm has fixed the problem.
Python path to be used in PyCharm settings: /Library/Frameworks/Python.framework/Versions/3.2/bin/python3
Incompatible third-party plug-ins may break PyCharm, uninstall/disable them in Preferences | Plugins.
Ensure the latest PyCharm version is installed.
User's code depends on the graphics.py module which was not in the project or in the PYTHONPATH. Putting it into the project has solved the problem.
Most likely the wrong Run/Debug configuration was used in PyCharm, the easiest way to run or debug such scripts is by using the editor context menu Run and Debug actions. PyCharm creates the configuration automatically and debugging works fine as shown of the screenshot:
If one wants to configure and debug it, he can use the code.zip file to get started.
Sorry for the comments mess above, but it was not possible to move it into chat as user had only 1 reputation point, hence not able to use the chat feature of StackOverflow.
I've been using Eclipse with PyDev (on Windows, mind you) for my Python Tkinter project for about a month now, and up until recently I've had no complaints. I start the source for one module (my GUI) like so:
from Tkinter import *
Now, ever since I updated Eclipse to 3.6.1, it shows an error for every call to the Tkinter module(Frame(), Label(), Tk(), etc.). I thought that something might have gone wrong during the update, so I uninstalled Eclipse, re-downloaded it (Eclipse 3.6.1 Classic), and reinstalled it. Then, seeing that that gave me a bunch of errors with installing PyDev, I removed that, got Eclipse 3.6.0 Classic, installed it, and got the same problem I was trying to fix earlier.
I don't understand what's wrong here. It doesn't make any sense to me why all of a sudden Eclipse would stop recognizing that I had imported Tkinter.
Can anyone offer any suggestions/input? I really want to stick with Eclipse, I'm very happy with it, but I can't deal with it giving me about 200 bogus errors.
You really shouldn't use wild imports. Consider from Tkinter import Frame, Label or import Tkinter as tk instead.
Now to your problem: I have Eclipse Helios, too (3.6.0.v20100602). The problem you describe clearly has to do with PyDev, not with the Eclipse base project. I just tried the same import and didn't get error messages. My PyDev version also retrieves the docstring of Frame correctly, for example.
I think it boils to just installing a newer version of PyDev (this is the solution for many bugs ^^) - add "http://pydev.org/nightly" as an update site and then upgrade to the latest version. I have version 1.6.3.20100922, by the way. If that doesn't help, you should consider reporting it as a bug.
I find the answer to problems like this is usually that you have to update your pythonpath from eclipse. See my answer to a similar question. I think re-installing pydev and/or eclipse usually solves this problem because in doing so, the pythonpath is re-configured.
Which Python version do You use? If > 3.1 try (note lowercase writing):
from tkinter import *