I can't open IDLE3 on osx11.1 - python

I've installed python 3.9.1 by homebrew.
benlai#laihongbindeAir ~ % idle3
macOS 11 or later required !
zsh: abort idle3
So... I don't know how to fix it.
Help
Or maybe there's something similar that I can use?
report: https://app.box.com/s/u1wm8wf3iqqtr6tebrbofo07pbx0ydta

If you install 3.9.1 directly from python.org, which is the first release of python to support Mac OS X Big Sur, it will install with its own and newer version of tcl/tk (v8.6) and will install a working IDLE at the same time. IDLE will also become visible in Spotlight Search, putting an end to having to fire up Terminal every time :-)

Related

Pycharm: import Serial is NOT working but i already did "pip3 install pyserial"

i am quite trouble why my pycharm does not recognize import serial. i am doing python code but i need to use Serial. so just from what i found:
i need to go to CMD, then enter "pip install pyserial" or "pip3 install pyserial"(this is what i did).
after that the installation seems successful, i didnt see any errors
after that. i went back to my Pycharm and type import serial or import pyserial
despite that, both code are not working...
i wonder what is the problem with my Python?
-Windows 10
-Python 3.10
-Pycharm Community Version: 2021.2.3
I had the same problem since I started using python 3.10.
I found that you have to download the complete pyserial package from github, unzip the entire package and edit the setup.py file and add the line 'Programming Language :: Python :: 3.10',
and then from the CMD window run python setup.py build
With that it works !!!
Just open the terminal within the Pycharm IDE and use pip to install on there.
Try uninstalling it from pip and then using the Python Packages tab to install it. It worked for me when I tried that.

download pygame for python 3.4 [duplicate]

So I have this little problem. When I try to install Pygame for Python 3.4 I download a .whl (wheel?) file and don't know how to use it. Some guys told me something about pip but don't know how to use/install it.
You can install the wheel file for Python 3.4 here:
First you have to install the wheel package from pip then install Pygame.
pip install wheel
pip install pygame‑1.9.2a0‑cp34‑none‑win_amd64.whl
Here's a video to help you install pip on Youtube.
Here is a great VIDEO tutorial: http://goo.gl/PurJqk (it is on youtube)
This is what I use to install .whl modules to python (I do this in the 64 bit windows cmd):
cd "C:\Users\(YOUR USERNAME)\Desktop"
(assuming that you have the .whl file on your desktop)
C:\Python34\Scripts\pip install filename.whl
(where filename.whl is the full name of the .whl file, with the .whl extension)
After that it will install, and you are free to use PyGame!
14 y/o? Good for you! You can put the file into your python/scripts folder and run pip install *file* (where *file* is your filename).
Here is a link to download pygame for different versions of Python, up to Python 3.4 in 32 bit and 64 bit.
To test if it installed properly, open your python shell and type in this code:
import pygame
Please note that these are not official binaries and you are basically trusting a third-party to compile and provide the binary for you.
Step 1
If you have not got python version 3.4.2, then you must uninstall your current version of python (or don't if you don't even have python).
Step 2
Then download and install python 3.4.2 from http://filehippo.com/download_python/58901/ .
Step 3
Follow the instructions and wait until it is ready for use.
Step 4
Now download the 'pygame-1.9.2a0-cp34-none-win32.whl' file from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame and copy it into C:\Python34\Scripts .
Step 5
In C:\Python34\Scripts hold the shift key and right click. Click on 'Open new command window here'.
Step 6
In the command window you have opened, type in:
pip3 install pygame-1.9.2a0-cp34-none-win32.whl
It will say something like:
Unpacking C:\Python34\Scripts\pygame-1.9.2a0-cp34-none-win32.whl
Installing collected packages: pygame
Successfully installed pygame
Cleaning up...
And it will then just say C:\Python34\Scripts>, which means that pygame has now been installed!
Step 7
Go to the Python 3.4.2 Shell, and type in:
import pygame
if there is an error, pygame didn't install properly, otherwise, congratulations!
You can then:
import pygame.examples.aliens as game
and then on the next line type in:
game.main()
to see a professional pygame example.
For more information, visit my website at:
https://ronaldobutrus.github.io/Site3/index.html
Good Luck! :)
https://bitbucket.org/pygame/pygame/downloads
"pygame-1.9.2a0-hg_5974ff8dae3c+.win32-py3.4.msi"
This is the package you want, RedNax said this but did not point out the exact package.
The other answer doesn't work for me on Windows 10 Pro N x64.
What did work was installing the win32.whl instead of amd64. I put this in my Python3.4\Scripts folder where pip is and ran
pip install pygame-1.9.2a0-cp34-none-win32.whl
This should work for others using a similar configuration.
In my experience, you need to make sure of two things:
1) Both Python and Pygame should be 32 bit - not either or both being 64 bit.
2) Both Python and Pygame should be compatible for the same version.
You may be able to get the 64 bit version to work, but not all packages have migrated to 64 bit and the small performance improvement isn't worth the frustration of trying to get it to work.
I also found the latest 32 bit Pygame (as of Feb. 5th, 2016) seems to work well with 32 bit Python 3.4.4.
I installed 32 bit python-3.4.4.msi on Windows 10 from my downloads folder to the folder C:\Python34.
Within the Python34 folder, I created a folder called "Project Directory".
In it, I placed "pygame-1.9.2a0-hg_ea3b3bb8714a.win32-py3.4.msi" which I think I got from https://bitbucket.org/pygame/pygame/downloads. Double-clicked on it. Worked the first time.
I had also installed "Microsoft Visual Studio Community 2015 with Update 1."
No idea if this helped solve the problem, but this MVSC package installs a lot of DLLs. It takes quite a while to get MVSC installed.
But - I now have Pygame working on Windows 10.
For linux if you root user then copy paste this into terminal
apt-get install python3-dev mercurial
apt-get install libsdl-image1.2-dev libsdl2-dev libsdl-ttf2.0-dev
apt-get install libsdl-mixer1.2-dev libportmidi-dev
apt-get install python-numpy
pip3 install --user hg+http://bitbucket.org/pygame/pygame
If you not root user then use sudo before start every-line.

Install numpy on Snow Leopard

When I try to install numpy over a python.org python2.6 installation, I get these errors on my OS X terminal.
sh: gcc-4.2: command not found
And this causes failure. I noticed a pastebin (http://pastebin.com/hieSKe3A) already on this issue but I'm unable to find an answer online that works for Snow Leopard (there seem to be a lot of answers for Lion).
I noticed numpy requires the python.org python2.6 installation. I'm trying to do that. Btw, if there is a way for me to prevent the installer of the numpy mpkg from checking the python version available? (If yes, I may have another hacky way to do this.)
Help?
Thanks.
You have two main options to install gcc 4.2 on Snow Leopard:
Download pre-built binaries from osx-gcc-installer. This is the simplest way.
Download the Command Line Tools for Xcode package in the Developer Center and follow this guide to make it install on Snow Leopard.
In terminal type “gcc“, you will get message “command not found”.
C or GCC compiler is needed some times and MAC OS X does not have this installed by default
to install gcc compiler you will need to download and install command line tools for xcode (see Apples developer page)

Homebrew failing to install postgresql; python 64-bit errors

I'm getting errors when running
$ brew install postgresql
==> Downloading http://ftp.postgresql.org/pub/source/v9.1.2/postgresql-9.1.2.tar.bz2
File already downloaded in /Users/neil/Library/Caches/Homebrew
Warning: Detected a framework Python that does not have 64-bit support in:
/Library/Frameworks/Python.framework/Versions/Current/Python
e configure script seems to prefer this version of Python over any others,
you may experience linker problems as described in:
http://osdir.com/ml/pgsql-general/2009-09/msg00160.html
fix this issue, you may need to either delete the version of Python
own above, or move it out of the way before brewing PostgreSQL.
te that a framework Python in /Library/Frameworks/Python.framework is
e "MacPython" version, and not the system-provided version which is in:
/System/Library/Frameworks/Python.framework
==> ./configure --disable-debug --prefix=/usr/local/Cellar/postgresql/9.1.2 --datadir=/usr/local/Cellar/postgresql/9.1.2/shar
^C
Here's where python is located.
$ which python
/usr/local/bin/python
I modified my ~/.zshrc PATH from
export PATH=/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin
to
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin
And although I'm getting python 64-bit errors, my version of python is 64-bit according to this SO post:
$ python -c 'import struct;print( 8 * struct.calcsize("P"))'
64
The problem pointed out in the referenced mailing list post is that the configure step isn't impacted by the PATH here. There's a whole other mechanism used to find things to link against; see Where do I set DYLD_LIBRARY_PATH on Mac OS X for a quick intro. You could try the suggested workaround given by the brew script--rename /Library/Frameworks/Python.framework/Versions/Current/Python to something else to get it out of the linker's search path, repeat the brew install, then put it back.
If you don't need Python bindings in your PostgreSQL, you can also just install it without Python bindings using brew install postgresql --no-python.
This command is installing the server, not the python bindings. Is that what you want? There is a installer for osx that will install the server for you.
Once you have done that, you can install the psycopg2 bindings directly from source.

Python interactive mode history and arrow keys

I was wondering if anyone can explain why all of a sudden in Python interactive mode all arrow keys are failing?
When I press up button for example to go through command history I get "^[[A". Same with any other arrow keys.
I have no idea why this happened and it was working before (on OS X Snow Leopard). Does anyone know a way to fix this?
Many thanks,
G
If you are using homebrew, this is an easy fix:
brew uninstall python
brew uninstall readline
brew install readline --universal
brew install python
That fixed it for me (running OS X Mavericks 10.9.5)
I finally got this working. I just had to install readline with easy_install and cursors and backspace started magically working.
sudo /opt/local/bin/easy_install-2.5 readline
You don't say which Python you are using but the symptoms you mention are indeed usually caused by Python not being built with readline support. These days Python on OS X can be built to use either the GNU readline library or the Apple-supplied editline library (AKA libedit). You can use the following two commands to show exactly which Python you are using. If that does not help you figure out what is going on, edit your question to show the output from those commands.
Here's an example that shows a recent MacPorts Python 2.6 on OS X 10.6:
$ python -c 'import sys;print(sys.version);print(sys.executable)'
2.6.5 (r265:79063, Jul 15 2010, 01:53:46)
[GCC 4.2.1 (Apple Inc. build 5659)]
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python
$ otool -L $(python -c 'import readline; print(readline.__file__)')
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload/readline.so:
/opt/local/lib/libreadline.6.1.dylib (compatibility version 6.0.0, current version 6.1.0)
/opt/local/lib/libncursesw.5.dylib (compatibility version 5.0.0, current version 5.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0)
The path prefix /opt/local/ is the default location for MacPorts-installed software and the output from otool indicates that this Python's readline module is dynamically linked to the MacPorts-installed GNU readline library.
This behaviour commonly shows when you do not have readline support. If you are using MacPorts, try port install readline, see if it will fix it. You can also see this page for some further explanations.
(Also useful to know: some programs do not use readline even if present on the system. You can force it on them by using rlwrap (port install rlwrap). For example: rlwrap ocaml -init code.ml will start up OCaml, read code.ml, and start REPL with readline support)
The command
brew install readline
worked for me.

Categories