I watched the instructional video here to install cx_Freeze.
https://www.youtube.com/watch?v=J81JFwqsS5o
It seems like the guy runs an executable to do the install. I downloaded the whl file from here.
https://pypi.python.org/pypi/cx_Freeze/5.1.1
I run it this way: pip install some-package.whl
I am using the Anaconda command prompt and Spyder 3.2.4. How can I actually install and/or run cx_Freeze? Thanks.
pip install should work fine. The actual way of testing the library would be to import and see the version.
If you wanted to create an executable using cx_freeze, try the setup script in the following link:
https://cx-freeze.readthedocs.io/en/latest/distutils.html
Related
I am doing coursework and one of the important requirements is to create a .bat file for scripts. The bat file should run the script. I took this step until one thought struck me.
Code .bat file:
#echo off
py -u "Task_1.py"
echo %ERRORLEVEL%
pause
In my code, I use many third-party libraries, including for creating an interface. Let's assume that this script will run on a computer without python. Is it possible to somehow write a .bat file that would check for the presence of python and third-party libraries, and in their absence would download them? Has anyone done something similar, could you suggest how this can be implemented?
You could have the .bat file run a python environment you make and pip install dependencies, would be worth looking into.
This answer says that curl comes with Windows version 10 or newer. Therefore I would just curl the installer:
curl https://www.python.org/ftp/python/3.10.1/python-3.10.1-amd64.exe
now run it with /quit as by this answer:
.\python-3.10.1-amd64.exe /quiet
Then you can install pip as suggested as an alternative method from the official pip website:
py -m pip install --upgrade pip
Now you can use pip install to get whatever libraries you might need:
pip install numpy
Note: I have not been able to test this on my Windows so use with caution
In your .bat script, you can first run py --version and check the return code of the command to see if Windows could find py.
If it couldn't:
Download a Python installer. I don't know which utility is supposed to do that on Windows, but it should look similar to this (wget on Linux, saves the installer as python-installer.exe):
wget -O python-installer.exe https://www.python.org/ftp/python/3.10.1/python-3.10.1-amd64.exe
Then launch it and let the user go through the installation:
./python-installer.exe
Then, execute pip install --user your libs to install the libaries if needed.
Then, run your Python script.
I found a post to check if python is installed or not (How do I test if Python is installed on Windows (10), and run an exe to install it if its not installed?). It explains it quite well.
For the modules I would suggest using pip and installing the required modules by a requirements file.
The first time I have installed Python on my machine, it was Spyder with Anaconda.
But, with this version, I wasn't able to install pyodbc.
So, I have install Visual Studio Code and everything works fine
But today, I have tried to update some libraries (like certify or scipy) but each time I use pip install, I update my Anaconda folder and not my WindowsApps folder.
So, when I use PIP, how to update the Windows folder and not Anaconda. And also how to remove Anaconda from my computer. In my Windows Settings, I have no app related to Anaconda (weird)
Check your path, and which pip executable is being executed.
If you run it with the full path to your install in WindowsApps, then it should detect and update that version.
You can check which pip you are using with the command of pip --version.
Press win to open the start menu and search uninstall-a to find the Uninstall-Anaconda3.exe or open the control-panel to uninstall it. Like the official docs recommended.
I've coded a game in Pygame using Pycharm, and I want to make it into a downloadable desktop application so that other people can download and use it even if they do not have python or the necessary files. The problem is I don't know how to. I've heard of py2exe and py2app before. I tried py2exe but then realized that .exe was for windows, and I was using a Mac. I read the py2app documentation, but it was very confusing and hard to understand, and none of the things they said worked. They said to use the pip command to install py2app inside the terminal, but I tried it and it said that it did not recognize the pip command. Can someone please help? Thanks!
Sorry if this question is long. I am trying to tell as much information as possible.
You can use pyinstaller if you package the application in Mac OS it will run on Mac.
Click here for instruction on how to install the package and use it.
Which installation of Python do you use? I had bad experience with Homebrew when it came to packaging, then I've removed it and switched to Python3.9 downloaded directly from python.org and everything works well now.
Depending on your Python installation, it is possible that you don't have pip installed on your computer. Via terminal, you can check it using
python -m pip --version
and you should get a response of this type:
pip X.Y.Z from .../site-packages/pip (python X.Y)
If you don't have pip, you can either re-install Python as mentioned above, or you can just install pip using these instructions.
As soon as you have pip installed, you can install py2app using
pip install py2app
I want to use this GitHub code for some purpose of mine. I'm on Mac (Sierra 10.12). So, I downloaded Anaconda on my Mac, and then opened up the terminal and typed
conda create -n robin python=3.7
and then typed source activate robin
I think that took me to my virtual environment. Then I downloaded the main github code, extracted it and then downloaded Pretrained models and extracted it in the same folder as the main github code.
Then I installed pytorch by the code given in its official page. And then typed pip install -r requirements.txt (by changing the directory to the Real-Time-Voice-Cloning folder).
I typed this code pip install webrtcvad-wheels. I thought that everything was done and therefore, I typed python demo_toolbox.py but got an error like this:
enter image description here
I tried installing pip3 install PyQt5and even conda install pyqt and they were get installed. After that, I typed python demo_toolbox.py but the same error appeared again. How to get that GUI toolbox?
I'm a beginner in programming so it will be more helpful if you can provide step by step processing.
It seems that you are using linux. Try : sudo apt-install qt5 or pyqt5
I am using Python 2.7.11 and am trying to pip install modules however a few of them are failing. The message I get is "Failure to build wheel for 'X'" and "Error: INCLUDE Environment Variable is empty".
I tried to install Scrapy, LXML and Twisted and those failed. Some other random modules I tried installed fine.
I have installed pyOpenSSL, added python27 and python27/scripts to environment.
Thanks,
I tried both the solutions offered, none worked.
I installed Microsoft Visual C++ Compiler for Python 2.7, download it here. Then run:
pip install scrapy
That worked for me
A quick solution is to install the pre-compiled version of lxml. You can find it here. If you use the .exe you can point it directly to your python root folder.
After that:
close and re-open cmd
pip install your_package (make sure cmd is in the correct directory)
enjoy having no frustrating lxml errors!
Hope this helped.
Use a pre built library from this link if you are on windows:
https://www.lfd.uci.edu/~gohlke/pythonlibs/
Choose the relevant library given python version and desktop config. For example
I want to install apell in python 3.6 and winamd64 then download this:
aspell_python-1.15-cp36-cp36m-win_amd64.whl
Now go to your console and type
pip install path-to-.whl
and that's it.