Recently, in I download and install Python 3.10, then uninstall Python 3.7 in win10.However, when I want to import some modules in script, it shows there is no modules. After checking, I found all modules are still saved in C:\Users\...\AppData\Roaming\Python\Python37
So if I want to use them, just copy/paste them into Python310? Need I change other things, like classpath...
If not, what should I do? download from Internet again?
Don't copy site site-packages dir from one version of Python to another - at best you'll get undefined behaviour. The appropriate way of getting the modules you want from v3.7 to v3.10 is to run pip list from the v3.7 installation to see what you have installed, then pip freeze to write that to a file, and finally use the v3.10 pip to install from the file that you wrote the list to.
This way you will get the modules built with and for v3.10.
I am writing a python program to design test scripts using Kivy (a User Interface Library), SQLAlchemy (an ORM), and OpenPyXL (Integration with Excel).
On Ubuntu 14.04, the package installs are very straightforward as all of the libraries install to the system python using pip from the terminal. The program compiles and runs without issue.
However, for Windows 7 & Windows 10, I am having difficulty installing the OpenPyXL Module. This is because Kivy ships as a "Portable" distribution for Windows, which includes it's own instance of Python that is run instead of the system python. The only other option is compiling Kivy from source.
SQLAlchemy can be downloaded with a setup-install.py script, and so I got that installed per the instructions I put up on github:
https://github.com/balex1/TestScriptBuilder
OpenPyXL only lists one installation method, however: pip. So, I am trying to run pip to install OpenPyXL from the Kivy python.exe file. Unfortunately, I see the same error every time. Here's the command from my Windows 10 computer (the path is a bit different on the Windows 7 computer, but the error is the same):
C:\Users\Alex\Documents\Kivy-1.9.0-py2.7-win32-x86\Python27\python.exe C:\Users\Alex\Documents\Kivy-1.9.0-py2.7-win32-x86\tools\pip.bat install openpyxl
The error returned is:
...\pip.bat, line 1
python.exe -m pip %*
^
SyntaxError: invalid syntax
After doing some research, I thought I might be missing something in my PATH Environment Variable, so I tried adding:
C:\Users\Alex\Documents\Kivy-1.9.0-py2.7-win32-x86\Python27\Lib\site-packages\pip
to the environment variable, but this did not work. I then tried adding the pip.exe file that I found in the Kivy Portable Python, but this also failed.
I tend to stick to Ubuntu, so I'm not quite sure where to move from here on the Windows platform. Is there a way to fit the last piece into this puzzle or do I need to compile Kivy on Windows from source?
Thanks in advance for your help!
Sincerely,
Alex
I have a simple python script that I have been trying to package into an RPM. This was a simple python script that you can run by calling "./". However, to package it into an RPM, I turned the script into a module with a init.py and setup.py. I was able to package it into an rpm using "python setup.py bdist_rpm" following https://docs.python.org/2.0/dist/creating-rpms.html . I was also able to install the created .noarch.rpm file into a different machine. However, I have no idea how to use this script now after I installed the .noarch.rpm file.
So, I successfully installed the .noarch.rpm file that has my script packaged into it, but I have no idea where this file is or how to use my script from this. This is my very first time creating an RPM, and I am fairly new to Python as well, so I think I am just missing something. Is there a way to specify where the python module is installed when I install the .noarch.rpm?
I am running on RHEL. I also looked at two other StackExchange questions/answers that are similar to what I want, but I still do not quite understand what to do. Here are the other questions/answers: Python distutils - Change Path RPM Installs To and Creating Python RPM
You can get list of files in your RPM package by:
rpm -qpl ./some_package.rpm
or when already installed:
rpm -ql some_package
I installed OpenERP 6.1 on windows using the AllInOne package. I did NOT install Python separately. Apparently OpenERP folders already contain the required python executables.
Now when I try to install certain addons, I usually come across requirements to install certain python modules. E.g. to install Jasper_Server, I need to install http2, pypdf and python-dime.
As there is no separate Python installation, there is no C:\Python or anything like that. Where and how do I install these python packages so that I am able to install the addon?
Thanks
Please check this link, may be helpful for you.
http://www.zbeanztech.com/blog/openerp-source-eclipse-under-windows
if you install the python package separately, then you have to add the bin path of the installed package to the system environment variable.
Good question..
Openerp on windows uses a dll for python (python26.dll in /Server/server of the openerp folder in program files). It looks like all the extra libraries are in the same folder, so you should be able to download the extra libraries to that folder and restart the service. (I usually stop the service and run it manually from the command line - its easier to see if there are any errors etc while debugging)
Let us know if you get it working!
Is there any way to install Setuptools for Python 2.6 in Windows without having an exe installer?
There isn't one built at the moment, and the maintainer of Setuptools has stated that it will probably be a while before he'll get to it.
Does anyone know of a way to install it anyway?
First Option - Online Installation (i.e. remaining connected to the Internet during the entire installation process):
Download setuptools-0.6c9.tar.gz
Use 7-zip to extract it to a folder(directory) outside your Windows Python installation folder
Go the folder (refer step 2) and run ez_setup.py from the corresponding dos (command) prompt
Ensure that your PATH includes the appropriate C:\Python2X\Scripts directory
Second Option:
Download setuptools-0.6c9.tar.gz
Download setuptools-0.6c9-py2.6.egg to a folder(directory) outside your Windows Python installation folder
Use 7-zip to extract ez_setup.py in the same folder as setuptools-0.6c9-py2.6.egg
Go to the corresponding dos prompt and run python ez_setup.py setuptools-0.6c9-py2.6.egg from the command prompt
Ensure that your PATH includes the appropriate C:\Python2X\Scripts directory
Third Option (assuming that you have Visual Studio 2005 or MinGW on your machine)
Download setuptools-0.6c9.tar.gz
Use 7-zip to extract it to a folder(directory) outside your Windows Python installation folder
Go the folder (refer step 2) and run python setup.py install from the corresponding dos (command) prompt
Please provide feedback.
You could download and run http://peak.telecommunity.com/dist/ez_setup.py. This will download and install setuptools.
[update]
This script no longer works - the version of setuptools the it downloads is not at the URI specified in ez_setup.py -navigate to http://pypi.python.org/packages/2.7/s/setuptools/ for the latest version - the script also does some md5 checking, I haven't looked into it any further.
The Nov. 21 answer didn't work for me. I got it working on my 64 bit Vista machine by following the Method 1 instructions, except for Step 3 I typed:
setup.py install
So, in summary, I did:
Download setuptools-0.6c9.tar.gz
Use 7-zip to extract it to a folder (directory) outside your Windows Python installation folder
At a DOS (command) prompt, cd to your the newly created setuptools-0.6c9 folder and type "setup.py install" (without the quotes).
Ensure that your PATH includes the appropriate C:\Python2X\Scripts directory
I'm able to find the EXE doing google,
you can simply download it from following URL, and double click and install....
http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11.win32-py2.6.exe#md5=1509752c3c2e64b5d0f9589aafe053dc
I got it working quickly by downloading the source and then running (from the extracted directory):
python.exe setup.py bdist_wininst
That builds dist\setuptools-0.6c9.win32.exe, which is exactly the installer you're looking for.
Just installed setuptools as follows:
Downloaded http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c9.tar.gz#md5=3864c01d9c719c8924c455714492295e , and extracted to a folder outside of my Python installation.
command prompt, then cd into that folder.
enter python setup.py install
That will install from the source into your python's site-packages folder and any other steps needed. This was on Windows XP SP2.
The "first option" (4 steps: download, extract, run, verify PATH) didn't work on my Windows Server 2008 x64 machine with Python 2.6 32 bit installed, nor did it work on my Vista x64 machine with Python 2.6 32 bit installed.
The "second option (5 steps: download, extract, extract, run, verify PATH) worked on both Windows Server 2008 x64 and on Windows Vista x64.
Thanks a bunch for providing the instructions!
OP option 1 did not work for me.
However doing setup.py install as mentioned by NathanD did do the trick.
Maybe that should become option 1?
Werner
The easiest setuptools installation option is to use the pre-packaged Windows Installer.
for 32-bit Python on Windows, the official setuptools page has been updated and has windows installers for Python 2.6 and 2.7:
http://pypi.python.org/pypi/setuptools
for 64-bit Python on Windows, setuptools Windows installers are available here:
http://www.lfd.uci.edu/~gohlke/pythonlibs/
setuptools has been updated in version 0.6c11.
My advice is to wait until Python 2.6.2 to use Python 2.6 on Windows. There are still some bugs that make it less than ideal (this one is particularly nasty). Personally, I wasn't able to get setuptools working totally well on Vista x64 even after installing from source. Under Python 2.5.4, I haven't had any problems though.
Second option worked for me.
Two notes:
a. After installing, when you using easy_install in vista, do so as administrator. (Right click on your command line shortcut and click "run as administrator"). I had trouble trying to run easy_install without doing that.
b. He means use ez_setup from setuptools-0.6c9.tar.gz
Python has everything on board to do this.
from https://pypi.python.org/pypi/setuptools#installing-and-using-setuptools I got the URL to the ez_setup.py: https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
instead downloading it and fiddling with the file we can do this from the console:
import urllib
url = 'https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py'
ezcode = urllib.urlopen(url).read()
exec(ezcode)
ActivePython already includes setuptools (Distribute actually), along with pip and virtualenv.