Python Forum

Full Version: How best to install easygraphics
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I am a relative newbie aged 74 years and have been following the online "Python for Everyone" course
run by University of Michigan.I have a Macbook pro running OSX Catalina and would now like to install easygraphics, but I can't by using the command "pip install easygraphics" from a zsh terminal.
I think that my main problems are related to the versions of software already installed on my Macbook.

Below are some responses:-

% pip install easygraphics
zsh: command not found: pip
So tried ...
% pip3 install easygraphics
Downloading/unpacking easygraphics
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement easygraphics
Cleaning up...
No distributions at all found for easygraphics
Storing debug log for failure in /Users/barry/.pip/pip.log

This is what is installed
% python --version
Python 2.7.16
% python3 --version
Python 3.4.2
% pip3 --version
pip 1.5.6 from /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages (python 3.4)

I have been able to successfully run some simple python programs with python3 both interactively and
using a xxxx.py file but to invoke my lastest version of python I have to type python3.

Having read some of the python.org documents I note that:

1. The latest stable Python release for Mac OSC is Python 3.7.7 - March 10, 2020 whereas
the version I have is very old Sad ---- Python 3.4.2 - Oct. 13, 2014

2. To install the lates pip requires the presence of PyQt5

3. According to the PyQt5 Reference Guide -- installing from wheels -- "Only Python v3.5 and later are supported.'

It's all somewhat a can of worms for a newbie Wall -- There's a hole in my bucket dear Liza !

My basic question is: "From where I am now, what is the easiest way for me to use easygraphics ?

Do I really need to update Python to version 3.7.7 first ?

Do I really need to install PyQt5 and if so how ? I note the latest version is in a folder called
PyQt5-5.14.3.dev2004081215

Having installed the latest pip how do I run it to install easygraphics ?

Before I install any of the above, do I have to uninstall any python related stuff first ?

If I do manage to successfully install all the latest stuff how should I run it/call it ?
e.g python , python3, python?, pip, pip3, pip?

Thank you for your time and I appreciate any helpful comments Smile

Barry_UK
I don't use Mac, so I cannot help HOW to install newer version of python, but for some of your other questions:
1. easygraphics requires min. python3.5, so you need to install newer version of python. I would not mess with the current system install of 3.4
2. PyQt is required by easygraphics, so once you manage to install newer version of python, and try to install easygraphics, it should install PyQT from PyPi as dependency
(Apr-14-2020, 06:05 PM)Barry_Uk Wrote: [ -> ]Do I really need to update Python to version 3.7.7 first ?
Yes that's advisable as 3.4 is old now.
Look at Doing it Right Mac.
(Apr-14-2020, 06:05 PM)Barry_Uk Wrote: [ -> ]If I do manage to successfully install all the latest stuff how should I run it/call it ?
In link you see that test with python -V and pip -V these should now point to 3.7 or 3.8.
All install is done be pip
pip install PyQt5

# Tool such as Qt Designer is included here
pip install pyqt5-tools
Over should work,here a demo of wheel install wheel PyQt5
pip install PyQt5-5.14.2-5.14.2-cp35.cp36.cp37.cp38-abi3-macosx_10_6_intel.whl
Do you have a link to easygraphics as there are a couple.
[/quote]
# Tool such as Qt Designer is included here
pip install pyqt5-tools[/python]

Over should work,here a demo of wheel install wheel PyQt5

pip install PyQt5-5.14.2-5.14.2-cp35.cp36.cp37.cp38-abi3-macosx_10_6_intel.whl
Do you have a link to easygraphics as there are a couple.
[/quote]
**********************************************************************************************
Thank you very much snippsat for your prompt and informative reply.

As I said, I'm a newbie, so it'll take some time for me to try out what you've suggested.
I'll report back (success or failure) after I've tried !

I've just downloaded the files for the latest Python 3.8.2 rather than 3.7.7, even though the latter has the slightly later date stamp ?

I don't really know what "Qt Designer" is or "wheel" and whether or not I need to use them ??

Do you mean that there are a couple of basically different packages both named easygraphics ?
I've downloaded my copy from https://pypi.org/project/easygraphics/
easygraphics 1.0.18
pip install easygraphics

I'm going to follow the installation guide you linked to Doing it Right Mac
https://docs.python-guide.org/starting/i...g-it-right and after a quick look it seems that I need to start with the OSX-GCC Installer package and Homebrew because at this stage I'm not adventurous enough to try XCode

Thanks again
Oh Dear ! I seem to have fallen at the first hurdle !!
I'm trying to follow the hitchhikers guide to installing the latest python the right way
https://docs.python-guide.org/starting/i...g-it-right
which says I need to install GCC first. This leads me to
https://github.com/not-kennethreitz/osx-...ler#readme
This isn't that clear. Because I don't want to install Xcode unless absolutely necessat it suggests that I can download pre-built binaries from
https://github.com/kennethreitz/osx-gcc-...7-v0.3.zip

When I do this I find that this version is for Mac OS X Lion only. Message
"Lion Only. OS X Lion is the only supported platform "

Lion is several years old and I have Catalina.

Help ! Where do I go from here ?
Yes i see that link is not updated,but it should be the same way for Catalina,need to find newer links.
I don't use Mac,here is a link you can look at.
How to Install Homebrew on macOS Catalina

When brew is installed then try:
# Maybe this now install Python 3 as default
brew install python

#Or
brew install python3
Also look here for more info,not sure if you need export Path.
Install Python 3 on MacOS
Quote:Optional, PATH environment
Set up PATH environment variable, if you used HomeBrew to install Python3, then HomeBrew already added PATH.
Here a Path demo of Path setup,but as mention if install Python 3 with HomeBrew it should be added to PATH automatically.
Install Python3 on a Mac
Hi Snippsat,
Here's an update of what I've been doing.

1. Ran % xcode-select --install
returns with: "xcode-select:note install request for command line developer tools"

It fires up a small window showing a small blue globe and start downloading something.
After about 10mins finishes with the message "The software was installed"

I now believe I have GCC installed because of the following:
~ % GCC --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.3 (clang-1103.0.32.29)
Target: x86_64-apple-darwin19.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

2. Went to https://www.python.org/downloads/mac-osx/
found latest version (Python 3.8.2 Feb24,2020) and downloaded its macos 64 bit installer
which is a package called "Python-3.8.2-macosx10.9.pkg"

When I click on this I get the following message:

"This package will install Python 3.8.2 for macOS 10.9 or later.

Python for macOS consists of the Python programming language interpreter and its batteries-included standard library to allow easy access to macOS features. It also includes the Python integrated development environment, IDLE. You can also use the included pip to download and install third-party packages from the Python Package Index.

At the end of this install, click on Install Certificates to install a set of current SSL root certificates."

Do you think it's worth trying to install Python and pip from this package before or instead of trying the Homebrew route ?

Thanks again
(Apr-15-2020, 04:45 PM)Barry_Uk Wrote: [ -> ]Do you think it's worth trying to install Python and pip from this package before or instead of trying the Homebrew route ?
I think Homebrew is the standard and safe way to install stuff on Mac,as it look it also update PATH environment to Python version it install automatically.
It's for sure the more easier and safer route it not sure how to this manually.

Now do also pyenv work on Mac,that's and other option you can look at.
have a tutorial here pyenv Simple Python Version Management here is wiki link to Mac.
Python Development on macOS with pyenv
pyenv on Mac OS 10.15 Catalina
Hi Snippsat again,

1. I tried to install homebrew and I think it was successful, but not sure:

~ % /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebr...er/install)"
Warning: The Ruby Homebrew installer is now deprecated and has been rewritten in
Bash. Please migrate to the following command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebr...install.sh)"

==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew

etc etc etc

Eventually it got to the end but i'm not sure if the following 2 Errors are significant
however it does say that the installation was successful ???

Error: Could not link:
/usr/local/share/man/man1/brew.1

Please delete these paths and run brew update.
Error: Could not link:
/usr/local/share/doc/homebrew


Please delete these paths and run brew update.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
https://docs.brew.sh/Analytics
No analytics data has been sent yet (or will be during this install run).

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
https://github.com/Homebrew/brew#donations

==> Next steps:
- Run brew help to get started
- Further documentation:
https://docs.brew.sh

2. Then I ran a version check
barry@Barrys-Macbook ~ % brew -v
Homebrew 2.2.13
Homebrew/homebrew-core (git revision b5b3b; last commit 2020-04-15)

3. Then tried to install Python

barry@Barrys-Macbook ~ % brew install python3
Updating Homebrew...
==> Installing dependencies for python: gdbm, [email protected], readline, sqlite and xz
==> Installing python dependency: gdbm
==> Downloading https://homebrew.bintray.com/bottles/gdb...e.1.tar.gz
######################################################################## 100.0%
==> Pouring gdbm-1.18.1.catalina.bottle.1.tar.gz

etc etc etc

[email protected] is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.

If you need to have [email protected] first in your PATH run:
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc

For compilers to find [email protected] you may need to set:
export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
export CPPFLAGS="-I/usr/local/opt/[email protected]/include"

==> Summary
? /usr/local/Cellar/[email protected]/1.1.1f: 8,057 files, 18MB
==> Installing python dependency: readline
==> Downloading https://homebrew.bintray.com/bottles/rea...tle.tar.gz
==> Downloading from https://akamai.bintray.com/6a/6ae1c8e7c7...1de361b5f1
######################################################################## 100.0%
==> Pouring readline-8.0.4.catalina.bottle.tar.gz
==> Caveats
readline is keg-only, which means it was not symlinked into /usr/local,
because macOS provides BSD libedit.


For compilers to find readline you may need to set:
export LDFLAGS="-L/usr/local/opt/readline/lib"
export CPPFLAGS="-I/usr/local/opt/readline/include"


--------------------------- and so on -----------------
There are several more caveats and finally one error message, which I'm not happy with

Error: The brew link step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/2to3
Target /usr/local/bin/2to3
already exists. You may want to remove it:
rm '/usr/local/bin/2to3'

To force the link and overwrite all conflicting files:
brew link --overwrite python

To list all files that would be deleted:
brew link --overwrite --dry-run python

Possible conflicting files are:
/usr/local/bin/2to3 -> /Library/Frameworks/Python.framework/Versions/3.4/bin/2to3
/usr/local/bin/idle3 -> /Library/Frameworks/Python.framework/Versions/3.4/bin/idle3
/usr/local/bin/pydoc3 -> /Library/Frameworks/Python.framework/Versions/3.4/bin/pydoc3
/usr/local/bin/python3 -> /Library/Frameworks/Python.framework/Versions/3.4/bin/python3
/usr/local/bin/python3-config -> /Library/Frameworks/Python.framework/Versions/3.4/bin/python3-config
/usr/local/bin/pyvenv -> /Library/Frameworks/Python.framework/Versions/3.4/bin/pyvenv
------------ and so on --------------

==> readline
readline is keg-only, which means it was not symlinked into /usr/local,
because macOS provides BSD libedit.


For compilers to find readline you may need to set:
export LDFLAGS="-L/usr/local/opt/readline/lib"
export CPPFLAGS="-I/usr/local/opt/readline/include"

==> sqlite
sqlite is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.


If you need to have sqlite first in your PATH run:
echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.zshrc

For compilers to find sqlite you may need to set:
export LDFLAGS="-L/usr/local/opt/sqlite/lib"
export CPPFLAGS="-I/usr/local/opt/sqlite/include"

==> python
Python has been installed as
/usr/local/bin/python3


Unversioned symlinks python, python-config, pip etc. pointing to
python3, python3-config, pip3 etc., respectively, have been installed into
/usr/local/opt/python/libexec/bin

You can install Python packages with
pip3 install <package>
They will install into the site-package directory
/usr/local/lib/python3.7/site-packages

See: https://docs.brew.sh/Homebrew-and-Python

4. I then did some version checks

barry@Barrys-Macbook ~ % which python
/usr/bin/python
barry@Barrys-Macbook ~ % python --version
Python 2.7.16
barry@Barrys-Macbook ~ % python3 --version
Python 3.4.2

Note that python3 is still the old version 3.4.2 rather than the new one 3.8.2,
so I'm pretty sure homebrew has failed to install Python


What's the best way forward ?

5. Another major problem is I can't find a .profile file with PATH's in it.
I'm running the zsh terminal on my macbook because that is the Catalina default but I can't find a .profile or .zsh_profile or anything like it. There is a very old bash profile which is probably a left over from an earlier macOSX, when bash was the default shell
167 18 Dec 2014 .bash_profile
So if I needed to, how could I create a .zsh_profile file with PATH's in it ??
Thanks again
(Apr-15-2020, 11:39 PM)Barry_Uk Wrote: [ -> ]2. Then I ran a version check
barry@Barrys-Macbook ~ % brew -v
Homebrew 2.2.13
Homebrew/homebrew-core (git revision b5b3b; last commit 2020-04-15)
Then Homebrew should have been install okay.
Look at this link.
Installing Python 3.7 on macOS
Then it should just be python now not Python3.
brew install python
Quote:To upgrade python in the future, you can run brew upgrade
brew upgrade
So this brew upgrade should now maybe pull down Python 3.8.

I know Linux and Windows installation option/problems very well,not so on Mac.
Look like HomeBrew should make this easy on Mac,as mention i do not use Mac.
Pages: 1 2