Error creating pytheapp for Ethereum on OSX - python

I am trying to install pyethapp on OSX but get an error right at the end ""python setup.py egg_info"". Any suggestions?
c233:json-server-api justinstaines$ pip install pyethapp
Collecting pyethapp
Downloading pyethapp-1.3.0-py2.py3-none-any.whl (334kB)
100% |████████████████████████████████| 337kB 1.2MB/s
Collecting statistics (from pyethapp)........
Collecting secp256k1 (from ethereum>=1.3.5->pyethapp)
Downloading secp256k1-0.12.1.tar.gz (144kB)
100% |████████████████████████████████| 153kB 2.3MB/s
Complete output from command python setup.py egg_info:
Your setuptools version (1.1.6) is too old to correctly install this package. Please upgrade to a newer version (>= 3.3).
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/rb/ydgvprfj6yg5q180740g1lpm0000gn/T/pip-build-KDbJvF/secp256k1/

Doh just realised
Your setuptools version (1.1.6) is too old to correctly install this package. Please upgrade to a newer version (>= 3.3).

Related

pip uninstalled and now I don't know what to do?

So this is what I've tried to do in Windows 10 cmd
C:\Users\lewis>pip install pandas
Collecting pandas
Downloading pandas-1.4.1-cp310-cp310-win_amd64.whl (10.6 MB)
---------------------------------------- 10.6/10.6 MB 8.2 MB/s eta 0:00:00
Collecting pytz>=2020.1
Downloading pytz-2022.1-py2.py3-none-any.whl (503 kB)
---------------------------------------- 503.5/503.5 KB 8.0 MB/s eta 0:00:00
Collecting numpy>=1.21.0
Downloading numpy-1.22.3-cp310-cp310-win_amd64.whl (14.7 MB)
---------------------------------------- 14.7/14.7 MB 8.5 MB/s eta 0:00:00
Collecting python-dateutil>=2.8.1
Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
---------------------------------------- 247.7/247.7 KB 5.1 MB/s eta 0:00:00
Collecting six>=1.5
Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: pytz, six, numpy, python-dateutil, pandas
Successfully installed numpy-1.22.3 pandas-1.4.1 python-dateutil-2.8.2 pytz-2022.1 six 1.16.0'
So the module I wanted seems to have succesfully installed before I was prompted with this message.
WARNING: You are using pip version 22.0.3; however, version 22.0.4 is available.
You should consider upgrading via the
'C:\Users\lewis\AppData\Local\Programs\Python\Python310\python.exe -m pip install --upgrade pip' command.'
So my pip is out of date woop! So I proceed to upgrade the pip.
C:\Users\lewis>pip install --upgrade pip
Requirement already satisfied: pip in
c:\users\lewis\appdata\local\programs\python\python310\lib\site-packages (22.0.3)
Collecting pip
Downloading pip-22.0.4-py3-none-any.whl (2.1 MB)
---------------------------------------- 2.1/2.1 MB 6.4 MB/s eta 0:00:00
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 22.0.3
Uninstalling pip-22.0.3:
Successfully uninstalled pip-22.0.3
Then this is where it all goes wrong.
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied:
'C:\\Users\\lewis\\AppData\\Local\\Temp\\pip-uninstall-un6fh2sa\\pip.exe'
Consider using the `--user` option or check the permissions.
So it doesn't reainstall a new version of pip so I'm left with nothing.
But it does still retrieve a version of pip from a file.
C:\Users\lewis>pip --version
pip 22.0.4 from C:\Users\lewis\AppData\Local\Programs\Python\Python310\lib\site-packages\pip (python 3.10)
What's happened here and how do I fix it. Not really that advanced on pip stuff. Thanks!
Is everything ok, you have numpy and pip installed and if you want to upgrade pip, just use the --user flag as is said in your own post:
pip install --upgrade --user pip

As a pip install user, am I supposed to have wheel installed?

Consider the usual scenario - I want to create a virtual environment and install some packages. Say
python3 -m venv venv
source venv/bin/activate
pip install databricks-cli
During the installation, I get an error
Building wheels for collected packages: databricks-cli
Building wheel for databricks-cli (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/paulius/Documents/wheeltest/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-m7jmyh1m/databricks-cli/setup.py'"'"'; __file__='"'"'/tmp/pip-install-m7jmyh1m/databricks-cli/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-maxix98x
cwd: /tmp/pip-install-m7jmyh1m/databricks-cli/
Complete output (8 lines):
/tmp/pip-install-m7jmyh1m/databricks-cli/setup.py:24: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: invalid command 'bdist_wheel'
----------------------------------------
ERROR: Failed building wheel for databricks-cli
While it is benign (the installation actually works), it is still annoying.
I know that pip install wheel resolves this, but wheel does not come with the virtual environment by default. So should I always add it to my requirements.txt, or maybe this is something that can be solved by the package maintainer (in this case databricks-cli) and hence I should open an issue in their Github?
Update: note that the wheel is not necessary to install wheels, in this example bunch of dependencies get successfully downloaded and installed as wheels. The only databricks-cli package gets the error, as it does not have a wheel, but for some reason, pip tries to build it.
Update 3:
To prevent it from the maintainer's perspective use:
setup_requires=["wheel"]
it looks like you're on Linux and using the pre-installed or otherwise modified Python and its setuptools.
I've experienced the same thing due to Debian cutting off parts of the packages in not quite a sane way and I have mainly had issues with the prebuilt python-setuptools and likes. Check if the version matches and if not, install setuptools from pip, that might help in the future.
I have setuptools 45.2.0 and had no issues installing the package as a wheel. Then I uninstalled wheel and dropped the cache dir and it installed it properly even from the tar.gz source.
Update 2:
It might or might not be resolved by requiring wheel package. If the setup.py expects bdist_wheel to be present prior to the installation (most likely), adding it to the setup() function will not help and a manual check for the package within the setup script (+ perhaps a reference in README) are necessary so an end-user can install it properly.
For example if it's not present on the system, just print a warning and call an exit(). That would be the least a maintainer should do.
Update:
Yes, in the case where you encounter bdist_wheel command missing you need to install wheel with pip instal wheel.
It's not required, but it's recommended. Pip will work just fine without wheels, but you'll be installing from source (tar.gz, .zip or .egg).
See the packaging discussion for whether to use wheel or egg (or source).
This was a pip bug, and the solution is to upgrade the pip. With the newest version things look fine:
(venv) paulius#xps:~/Documents/wheeltest$ pip install databricks-cli
Collecting databricks-cli
Using cached databricks-cli-0.14.3.tar.gz (54 kB)
Collecting click>=6.7
Using cached click-8.0.1-py3-none-any.whl (97 kB)
Collecting requests>=2.17.3
Using cached requests-2.26.0-py2.py3-none-any.whl (62 kB)
Collecting six>=1.10.0
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting tabulate>=0.7.7
Using cached tabulate-0.8.9-py3-none-any.whl (25 kB)
Collecting idna<4,>=2.5
Using cached idna-3.2-py3-none-any.whl (59 kB)
Collecting certifi>=2017.4.17
Using cached certifi-2021.5.30-py2.py3-none-any.whl (145 kB)
Collecting urllib3<1.27,>=1.21.1
Using cached urllib3-1.26.6-py2.py3-none-any.whl (138 kB)
Collecting charset-normalizer~=2.0.0
Using cached charset_normalizer-2.0.1-py3-none-any.whl (35 kB)
Using legacy 'setup.py install' for databricks-cli, since package 'wheel' is not installed.
Installing collected packages: urllib3, idna, charset-normalizer, certifi, tabulate, six, requests, click, databricks-cli
Running setup.py install for databricks-cli ... done
Successfully installed certifi-2021.5.30 charset-normalizer-2.0.1 click-8.0.1 databricks-cli-0.14.3 idna-3.2 requests-2.26.0 six-1.16.0 tabulate-0.8.9 urllib3-1.26.6
Note the Using legacy 'setup.py install' ... line.
This is a related issue in the pip github https://github.com/pypa/pip/issues/8302. Not exactly that, but there is an explanation in the comments on what's the wheel building logic supposed to by.

Issues importing python-pptx on Linux (Ubuntu 17)

I am trying to import the python pptx library in a python programm. I installed it using pip before, which gave me the following output:
Collecting python-pptx
Downloading python-pptx-0.6.6.tar.gz (8.4MB)
100% |████████████████████████████████| 8.4MB 132kB/s
Collecting Pillow>=2.6.1 (from python-pptx)
Downloading Pillow-4.2.1-cp27-cp27mu-manylinux1_x86_64.whl (5.8MB)
100% |████████████████████████████████| 5.8MB 193kB/s
Collecting XlsxWriter>=0.5.7 (from python-pptx)
Downloading XlsxWriter-0.9.8-py2.py3-none-any.whl (137kB)
100% |████████████████████████████████| 143kB 1.2MB/s
Collecting lxml>=3.1.0 (from python-pptx)
Downloading lxml-3.8.0-cp27-cp27mu-manylinux1_x86_64.whl (6.8MB)
100% |████████████████████████████████| 6.8MB 166kB/s
Collecting olefile (from Pillow>=2.6.1->python-pptx)
Downloading olefile-0.44.zip (74kB)
100% |████████████████████████████████| 81kB 1.3MB/s
Building wheels for collected packages: python-pptx, olefile
Running setup.py bdist_wheel for python-pptx ... done
Stored in directory: /home/clemens/.cache/pip/wheels/27/f8 /dc/181ed5439001413ee0c1c8794a06009c4c0b96f652401e2d20
Running setup.py bdist_wheel for olefile ... done
Stored in directory: /home/clemens/.cache/pip/wheels/20/58 /49/cc7bd00345397059149a10b0259ef38b867935ea2ecff99a9b
Successfully built python-pptx olefile
Installing collected packages: olefile, Pillow, XlsxWriter, lxml, python-pptx
Successfully installed Pillow-4.2.1 XlsxWriter-0.9.8 lxml-3.8.0 olefile-0.44 python-pptx-0.6.6
So this seems to be a success.
But as I am trying to import the module using the following code:
try:
from pptx import Presentation
except Exception as e:
print(e)
It says No module named 'pptx'.
It must have something to do with Linux since the same code works just fine on windows and the module seems to be installed correctly. I am using Python 3.5.3.
Using pip install, you'll install it for Python2, not for Python3. To make sure it gets installed for Python3, invoke pip from the interpreter, like this:
python3 -m pip install <package>

Cannot install PyAutoGUI

I tried installing PyAutoGUI-0.9.35 but the following came up when running cmd in the same folder:
my input: pip install PyAutoGUI-0.9.35
output:
Collecting PyAutoGUI-0.9.35
Could not find a version that satisfies the requirement PyAutoGUI-0.9.35 (from versions: )
No matching distribution found for PyAutoGUI-0.9.35
I then tried running the setup.py file from PyAutoGUI folder, but this showed up this time:
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [opts2_opts]...]
or: setyp.py --help [cmd1 cmd2...]
or: setup.py --help-commands
or: setup.py cmd --help
error: no commands supplied
the window immediately shut down so I had to take a quick screenshot
could anyone please tell me what I'm doing wrong? I run python 3.6, the required version for pyautogui is 3.4, I also run Win 10.
Try:
pip install pyautogui==0.9.35
Here's what happened when I did in a cmd session:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Windows\System32>pip install PyAutoGUI-0.9.35
Collecting PyAutoGUI-0.9.35
Could not find a version that satisfies the requirement PyAutoGUI-0.9.35 (from
versions: )
No matching distribution found for PyAutoGUI-0.9.35
C:\Windows\System32>pip install pyautogui==0.9.35
Collecting pyautogui==0.9.35
Downloading PyAutoGUI-0.9.35.zip (57kB)
100% |################################| 61kB 223kB/s
Collecting pymsgbox (from pyautogui==0.9.35)
Downloading PyMsgBox-1.0.6.zip
Collecting PyTweening>=1.0.1 (from pyautogui==0.9.35)
Downloading PyTweening-1.0.3.zip
Requirement already satisfied: Pillow in c:\python35\lib\site-packages (from pya
utogui==0.9.35)
Collecting pyscreeze (from pyautogui==0.9.35)
Downloading PyScreeze-0.1.9.tar.gz
Requirement already satisfied: olefile in c:\python35\lib\site-packages (from Pi
llow->pyautogui==0.9.35)
Building wheels for collected packages: pyautogui, pymsgbox, PyTweening, pyscree
ze
Running setup.py bdist_wheel for pyautogui ... done
Stored in directory: C:\Users\me\AppData\Local\pip\Cache\wheels\28\
3b\07\64bee61ca73d56260a47d6b49692e7f217a69568aae2117167
Running setup.py bdist_wheel for pymsgbox ... done
Stored in directory: C:\Users\me\AppData\Local\pip\Cache\wheels\c1\
cb\86\c3c2e3c39f9f0d015cf0f94ab6ca41e14f8c2083846e82b91d
Running setup.py bdist_wheel for PyTweening ... done
Stored in directory: C:\Users\me\AppData\Local\pip\Cache\wheels\04\
86\59\70a93cd378740b5266c51e11c36ee3fc8b9dfef4b3bc72fd82
Running setup.py bdist_wheel for pyscreeze ... done
Stored in directory: C:\Users\me\AppData\Local\pip\Cache\wheels\6a\
f7\db\9521ae30a53499f6c9024df5f5a605d56b6e6ad0c2d48dcb42
Successfully built pyautogui pymsgbox PyTweening pyscreeze
Installing collected packages: pymsgbox, PyTweening, pyscreeze, pyautogui
Successfully installed PyTweening-1.0.3 pyautogui-0.9.35 pymsgbox-1.0.6 pyscreez
e-0.1.9
C:\Windows\System32>
1. Method
If your Python is not updated, then update your Python, then install pyaudiogui.
2. Method
pip install pyautogui==0.9.35

Single pip command to install a tarball or zip as a wheel

I have been unable to find a single pip command to install from a repository (svn, git) or tarball/zip as a wheel. I'm using Python 2.7. For example, Genshi is only available from PyPI as tarball or zip. The package is installed as an egg:
~$virtualenv pve
New python executable in /Users/rjollos/pve/bin/python2.7
Also creating executable in /Users/rjollos/pve/bin/python
Installing setuptools, pip, wheel...done.
~$. pve/bin/activate
(pve) ~$pip install -U pip wheel setuptools
Collecting pip
Using cached pip-9.0.1-py2.py3-none-any.whl
Collecting wheel
Using cached wheel-0.29.0-py2.py3-none-any.whl
Collecting setuptools
Downloading setuptools-34.2.0-py2.py3-none-any.whl (389kB)
100% |████████████████████████████████| 393kB 810kB/s
Collecting packaging>=16.8 (from setuptools)
Using cached packaging-16.8-py2.py3-none-any.whl
Collecting six>=1.6.0 (from setuptools)
Using cached six-1.10.0-py2.py3-none-any.whl
Collecting appdirs>=1.4.0 (from setuptools)
Using cached appdirs-1.4.0-py2.py3-none-any.whl
Collecting pyparsing (from packaging>=16.8->setuptools)
Using cached pyparsing-2.1.10-py2.py3-none-any.whl
Installing collected packages: pip, wheel, six, pyparsing, packaging, appdirs, setuptools
Found existing installation: pip 8.0.2
Uninstalling pip-8.0.2:
Successfully uninstalled pip-8.0.2
Found existing installation: wheel 0.26.0
Uninstalling wheel-0.26.0:
Successfully uninstalled wheel-0.26.0
Found existing installation: setuptools 19.6.2
Uninstalling setuptools-19.6.2:
Successfully uninstalled setuptools-19.6.2
Successfully installed appdirs-1.4.0 packaging-16.8 pip-9.0.1 pyparsing-2.1.10 setuptools-34.2.0 six-1.10.0 wheel-0.29.0
$pip install --no-cache-dir genshi
Collecting genshi
Downloading Genshi-0.7.tar.gz (491kB)
100% |████████████████████████████████| 501kB 1.8MB/s
Installing collected packages: genshi
Running setup.py install for gens
$ls -ld pve/lib/python2.7/site-packages/Genshi*
drwxr-xr-x 9 rjollos staff 306 Feb 16 00:36 pve/lib/python2.7/site-packages/Genshi-0.7-py2.7.egg-info
As a workaround, I can create a wheel and then install the wheel:
(pve) ~$pip wheel --no-cache-dir --wheel-dir wheels genshi
Collecting genshi
Downloading Genshi-0.7.tar.gz (491kB)
100% |████████████████████████████████| 501kB 1.7MB/s
Building wheels for collected packages: genshi
Running setup.py bdist_wheel for genshi ... done
Stored in directory: /Users/rjollos/wheels
Successfully built genshi
(pve) ~$pip install wheels/Genshi-0.7-cp27-cp27m-macosx_10_12_x86_64.whl
Processing ./wheels/Genshi-0.7-cp27-cp27m-macosx_10_12_x86_64.whl
Installing collected packages: Genshi
Successfully installed Genshi-0.7
(pve) ~$ls -ld pve/lib/python2.7/site-packages/Genshi*
drwxr-xr-x 10 rjollos staff 340 Feb 16 00:43 pve/lib/python2.7/site-packages/Genshi-0.7.dist-info
Is there a way to build and install a wheel from a tarball/zip archive in a single pip command? There doesn't appear to be a --wheel option for pip install. There's an --only-binary option, but it will fail if a prebuilt wheel can't be found.

Categories

Resources