Unable to install pywinauto tool - python

Unable to install pywinauto with below error. Please help me to over come this.
C:\Python27>python C:\Users\........\Downloads\pywinauto-0.4.0\pywinauto-0.4.
0\setup.py install
running install
running build
running build_py
error: package directory 'pywinauto' does not exist

The way I did it was this:
Extracted the .zip file
Moved the folder into:C:\Python27\Lib\site-packages
Ran setup.py by going into the folder and double-clicking it.
That worked for me, and that is the normal way of moving modules into Python.

try this
Downloaded http://www.python.org/download/releases/2.6.6/ (32 bit)
Installed python using python-2.6.6.msi
Install send keys
https://code.google.com/p/pythonxy/downloads/detail?name=SendKeys-0.3_py26.exe&can=2&q=
Downloaded
http://sourceforge.net/projects/pywinauto/files/pywinauto/0.4.0/
Unzip the pywinauto zip file to a folder
Run python.exe setup.py install
C:\Software\pywinauto-0.4.0\pywinauto-0.4.0>C:\Python26\python.exe
setup.py install

This issue :"error: package directory 'pywinauto' does not exist" appears if you start setup process from wrong work dirrectory.
In my case (Win7x64, ActivePython2.7.2) I got same issue till I done next:
*precondtion: you should install Python first
1) go in PowerShell to directory with unzipped PyWinAuto: "cd: C:\Python27\Lib\site-packages\pywinauto"
you should navigate to folder with unzipped PyWinAuto
2) then do "python setup.py install"
Then you can check for installed PyWinAuto:
1) "import application"
2) "app = application.Application().start_("notepad")"
notepad.exe should appears

Related

How to install Python libraries on a pc without connection

I've been facing a problem for some time and I'm not finding a solution. At the company where I work, I'm trying to implement Python, but when I run the conventional command "Pip install pandas" in my vscode terminal, it gives an error because the company blocks the installation of external libraries, so it's as if I had to install these libraries on a PC without connection.
How should I follow this procedure?
I downloaded the .whl library from PyPi:
pandas-1.5.2-cp310-cp310-win_amd64.whl
ran pip install pandas-1.5.2-cp310-cp310-win_amd64.whl -f ./ --no-index --no-deps
Ok, the installation was successful. But this installation of pandas by cmd is not going to my system, because when trying to import pandas in my vscode it is not running, as if it had not been installed.
Would it be possible for me to download several libraries and leave them located in a folder where everyone in the company can use them? example using a function where I declare my path where all the libraries will be, and then I import them from there??
First confirm if you can run any python commands from VSCode. If the answer is yes, you can proceed to install your .whl file in python script folder.
Look for the Scripts folder
Add in your .whl file in this folder
Then open the folder, select the path, press Ctrl+D to display full path, type in cmd to open command prompt to this directory
Then just run your pip install here and you should be good to go
Remember the key is that your VSCode must be able to find Python.exe. If it can't from the start, you will need to add your python directory to PATH in environment variable

Install PyQt5.15.4 from tar.gz file

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

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 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).

Django installation problem on Windows

I am trying to install Django on Windows XP. Here is what I did:
(1) Downloaded and installed Python 2.7 from
http://python.org/ftp/python/2.7/python-2.7.msi
in C:\Python27
(2) Downloaded Django 1.2.1 from
http://www.djangoproject.com/download/1.2.1/tarball/
(3). After unzipping the file I placed Django's folder inside Python's site packages folder as below:
C:\Python27\Lib\site-packages\Django-1.2.1
(4). Now when I try to run "setup.py" in Django folder, I get the following error:
Traceback (most recent call last):
File "C:\Python27\Lib\site-packages\Django-1.2.1\setup.py", line 48, in <module>
root_dir = os.path.dirname(__file__)
NameError: name '__file__' is not defined
Screenshot can be seen below:
What am I doing wrong?
Thanks
Alternative method
Install easy_install : http://pypi.python.org/pypi/setuptools
Add C:\Python27\Scripts to your system path
Open a command line and enter easy_install django.
This will pull the latest version of Django off the PyPI website, and install it in that directory.
easy_install is definitely my favorite method for installing python modules.
Delete C:\Python27\Lib\site-packages\Django-1.2.1
Unzip tarball anywhere you want, then copy "django" subfolder from unpacked tarball into c:\Python27\lib\site-packages\, and you're done. You don't need to run setup.py actually.
If you want to install using setup.py, then open your command shell (press Win+R, type "cmd" and press Enter), change into dir you unpacked archive to (e.g. c:\archive\Django-1.2.1), and run "C:\Python27\python.exe setup.py install" without quotes.
Important note: you must run command shell with administrator privileges.
An alternate all-in-one open source Windows installer for Django that installs Apache, Python, etc.: Djangostack

Categories

Resources