Install PyQt5.15.4 from tar.gz file - python

I'm trying to install PyQt5.15.4 on a remote desktop that is not connected to internet (Anaconda distribution and PyCharm installed), hence I downloaded the tar.gz files from https://pypi.org/project/PyQt5/#files and tried to use this solution : Python import library from tar.gz? (it worked for other libraries I had to install such as python-docx). The problem is that there is no setup.py file. There is a configure.py file (I imagine it roughly do the same job), so I tried in cmd :
python configure.py install --prefix=<full path folder I used for other libraries I needed>
but I get:
Usage: python configure.py [opts] [name=value] [name+=value]
configure.py: error: no such option: --prefix
Do you have a tip ?

Download PyQT5 from here. https://www.riverbankcomputing.com/pypi/packages/PyQt5/PyQt5-5.15.5.dev2108100905.tar.gz#md5=b39c03d821123c37715daffb0c1c3bb1
This will download tar.gz fie. open the terminal, CD through the relative path, paste the command here.
pip install PyQt5-5.15.5.dev2108100905.tar.gz
if you have your own tar.gz. Then use the name of that file, which will install automatically.
pip install yourfile.tar.gz
Please let me know if that works

Related

pyinstaller downloaded using pip not working after installation

Screenshot of error
I'm trying to install a module called pyinstaller from pip to make .py files into an executable, but can't run it from command prompt. Any ideas as to why it doesn't work or workarounds with other applications that serve the same purpose?
try changing directory to where python location is and try installing again
i.e C:\Users--------------------\AppData\Local\Programs\Python\Python39> pip install pyinstaller

How do I run this python script?

I'm new to python, and I was wondering if you could help me run a python script. I'm trying to run a script called PunchBox from Github: https://github.com/psav/punchbox. So far, I have Python 3.9.5 and Git Bash.
In the GitHub page, it says:
To install, clone the repo, cd into it and then execute the following:
virtualenv -p python2 .pb2
source .pb2/bin/activate
pip install -U pip
pip install .
What does this mean exactly? Where do I run this code?
So far, I tried downloading the zip file from GitHub, installing Python 3.5.9, using cmd, finding the directory with cd, and running that code; but got an error:
Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name punchbox was given, but was not able to be found.
error in punchbox setup command: Error parsing C:\Users\Mi\Downloads\punchbox-master\punchbox-master\setup.cfg: Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name punchbox was given, but was not able to be found.
There's also a requirements.txt that lists additional scripts needed:
pre-commit
click
mido
pbr
PyYAML
svgwrite
Do these install automatically upon running the script for the first time?
I'm a little confused why I'm getting an error. Do you know what I'm doing wrong?
Thank you so much!
Giovanni
I assume you are new to programming. You have to write these lines in a terminal.
On Windows, it is Command Prompt or PowerShell Applications (latter preferred). On macOS, it is terminal
Copy all these lines at once, and paste them to your preferred terminal. The terminal will automatically run these one after the another.
FYI: Venv is a python package to create a virtual environment. The preceding commands set up the environment. Now install the required dependencies using this command instead of the last command (pip install .)
pip install -r requirements.txt
Based on your comment, it looks like you don't have virtualenv installed in your system. You may install it using the command pip install virtualenv.
Now, as you are using a Windows machine, you may open a Command Prompt or Windows PowerShell window and navigate to the directory where your cloned project resides.
Now, execute the following commands.
virtualenv -p python2 .pb2
.pb2\Scripts\activate.bat
pip install -U pip
pip install -r requirements.txt
Once you are done working in your virtual environment (which is named .pb2), you may close it by executing deactivate command.
#Giovanni T.
See, as far as you have installed Python and also downloaded the GitHub Repository as a zip file.
pip install -r requirements.txt
Just run this command.
Please make sure that the directory is pointing to the folder where this requirements.txt file is stored.

Installing package on MS Azure when PIP doesnt work

I'm trying to install this https://github.com/mrjbq7/ta-lib package on MS Azure Jupyter notebook environment. In my local anaconda environment, this all worked well.
PIP produces the first error that is described in the troubleshooting section, but I dont understand the solution.
Next, I tried the terminal on the azure project site, but when I try to load the tar file with wget -c url, I get denied permission.
I can upload the tar file into the project folder but then I have no clue how to find the file via the terminal.
Is there another way I can try?
There is not gcc distribution and sudo permission in MS Jupyter notebook, so you will get the error as the figure below when tried to install TA-Lib via pip, because there is not its pre-compiled wheel file for installation in its PyPI page and the talib Python package requires gcc for compiling the TA-Lib source codes in C.
So the solution is to compile and package the talib library as a wheel file from source code manually, then to upload and install it with its dependencies to Microsoft Azure Notebook, finally you can make the sample code works as the figure below.
Here is my steps in details, I did it in the WSL of my local Windows machine. You can try to do the same in a Linux machine
To create a new directory and init it with virtualenv in Python 3.6
Follow the README.md content of mrjbq7/ta-lib to install the TA-Lib C source codes as the dependencies of TA-Lib Python package. It required gcc, make installed in Linux first.
Download the source codes of mrjbq7/ta-lib from its releases page, then to decompress and compile it as the commands below.
$ tar -xzf TA_Lib-0.4.17.tar.gz
$ cd ta-lib-TA_Lib-0.4.17
$ pip install numpy
$ make
$ pip wheel --wheel-dir=talib ta-lib
$ cd talib
After do Step 3 successfully, there is a file named TA_Lib-0.4.17-cp36-cp36m-linux_x86_64.whl in the talib directory, as the figure below.
IMPORTANT: TA-Lib requires a runtime lib named libta_lib.so.0 compiled from Step 3, that you can find it in the path /usr/lib and its real file be named libta_lib.so.0.0.0, so you need to copy libta_lib.so.0.0.0 and rename it with libta_lib.so.0.
Upload the files TA_Lib-0.4.17-cp36-cp36m-linux_x86_64.whl and libta_lib.so.0 of Step 4 & 5 to your project in MS Azure Notebook, as the figure below.
Finally, you can install TA-Lib from your own wheel file and run it successfully.
thanks for the extensive answer. After some back and forth i managed to compile something that looks similar to your wheel file. I used the win10 ubuntu terminal and that had its own issue with all sorts of dependencies missing by default.
Anyway it looks now like i compiled the .whl file under python 2.7 which the Azure environment doesn't accept, although im pretty sure that i upgraded the ubuntu python version to 3.6
!pip install TA_Lib-0.4.17-cp27-cp27mu-linux_x86_64.whl
ERROR: TA_Lib-0.4.17-cp27-cp27mu-linux_x86_64.whl is not a supported wheel on this platform.
Since i have to probably repeat the process, some detail questions:
1) What do I need the virtualenv for in step one? My ubuntu distro should already be setup with python right?
2) Do i need step 2 and 3? to my untrained eye it looks like step 3 is just step 2 with and updated tar file.

How to install library with pip-console?

I downloaded some python library package (for example uncompile2) from GitHub. How I can install it into Qpython from the directory in my android device with pip-console? Or at least to try install...
You could install it directly through pip console, just type "pip install "
Or, you can make a .sh file with contents
python /your/path/to/the/package/setup.py install
Or at least I think so.
You could copy the modules you want installed into the site-packages folder
using a file manager open up the folder:
/sdcard/com.hipipal.qpyplus/lib/python2.7/site-packages/
that is where you can put the modules, i have not tried it with the pip console.

How do I install py2app onan off-internet PC

I have downloaded py2app, but the problem is that easy install seems to be an online installation, yet I am installing this on an off-line pc, so can't use easy install. I expected to be able to download an EXE file or MSI file to install it on my PC using a normal procedure to install a Python package, because the python packages that I have installed before have been from self running files.
The downloadable version of Py2app does not include any such self running file. It tells me to type $python setup.py install. Where do I type this? Into what command line?
If you're running Windows (and it seems that you're) you will need to go to the Run window (Win + R) and...
type cmd
type python setup.py install
...to begin the instalation.
If you doesn't have Python on your PATH, the use:
C:\PythonXY\python.exe setup.py install (for example, in Python 2.7 use C:\Python27\python.exe setup.py install).
Also maybe you need to specify the setup.py path so you should do:
C:\PythonXY\python.exe C:\Some\Path\setup.py install.
If you're running any Linux distro then just open the terminal and type that command.
Hope it helps!
You need to download an install the following packages (in this order):
altgraph
macholib
modulegraph
py2app
All of them can be installed by first downloading and extracting the archive and then run "python setup.py install" with the current working directory set to the directory containing the setup.py file.
However... You appear to want to install py2app on a Windows PC, and that won't work because py2app does not support Windows (it cannot cross "compile" a Mac application bundle).

Categories

Resources