Copy Pywinauto module from one PC to another - python

I have pip installed the pywinauto module in my laptop. I want to install it on my work computer. But there is a proxy and I don´t know how to install pywinauto behind the proxy (I found on the internet that I should use --proxy http://user:pass#proxyAddress:proxyPort but I don´t have a username and password).
I thought maybe I could locate my Pywinauto file on my laptop and paste it on my fixed computer. I have already located it in my laptop (in \Anaconda3\Lib\site-packages\pywinauto) but will it work to send it to my fixed computer and paste it on \Anaconda3\Lib\site-packages?
Thank you very much

You can download and copy latest pywinauto source code (now it is https://github.com/pywinauto/pywinauto/archive/refs/tags/0.6.8.zip), unpack it and run python setup.py install on your work PC. Though you need also to install dependencies the same way. They are all mentioned in Manual Installation.
BTW, pip install can work with local zip/tar.gz archive. I'd recommend to install wheel package first and then install pywin32 from downloaded .whl file by pip.
P.S. In more complicated case it's possible to set up local PyPI index available in your work network without proxy. But I guess it's not so easy for you.

Related

Is it possible to do 'pip install sas7bdat' without internet?

hi I have Anaconda installed at work. I tried to pip install sas7bdat, it does not work seems because I don't have internet access or any access to whatever could be downloaded....
Is there a way to pip install sas7bdat if I dont have internet access or external source. Is the file I need to install already inside my computer given I have Anaconda installed? Please kindly assist.
I dont have access due to security reason.
Anaconda should already include sas7bdat, it should be available in your base environment (see package list)
You can download sas7bdat wheel manually and then install it.
See: https://stackoverflow.com/a/27909082/5304366
You can also use a portable Python scientific distribution (e.g. WinPython) that may include sas7bdat.
You could probably also setup a local/private pypi server that would allow you to pip install any package. But I guess it is more work.

Windows machine Installing pycurl module on Thonny

I am trying to install pycurl module in Thonny virtual environment but without any luck..
Whatever I try, I am getting the same error message:
Please specify --curl-dir=/path/to/built/libcurl
I have previously installed this module on my Raspberry PI linux and did not have any issues whatsoever. Seems like a lot of people are having issues installing it on Windows Machine and there is still no clear solution to this.
According to the official pycurl website:
http://pycurl.io/docs/latest/install.html#windows
I should be able to install pycurl by using pip install pycurl. That is not the case unfortunately.
Also, they provide a link that is not working:
Clicking on the link returns "Forbidden".
Hoping to get some clarification. Thanks in advance.
If you want to install the current version, you need to build it from source.
You may be able to find a binary of a previous version to install through pypi.

Can python packages be downloaded with dependencies when neither python and pip are available?

I'm in a situation, where I have internet access on a computer but do not have permisson to install anything and python is missing as well.
Python on the other hand is installed on another computer without internet access. Both are in separate networks but i can transfer files through a file server which is connected to each computer as a networkn drive.
My quesion is, if it is possible to download packages with all the dependencies without having python and pip installed, than transfer the file and finally install it.
I simply tried to install a downloaded package from the PyPi Website as a *.zip or *.tar.gz file using the cmd with
chdir \path\to\package\file
python setup.py install
Importing that package afterwards creates errors as the dependencies are missing.
It would be totally fine if I just download Anaconda as all needed packages are already included with the installation. But I would still have the same problem when I want to update the packages.

Installing librdkafka on Windows to support Python development

A little background: I am working on some python modules that other developers on our team will use. A common theme of each module is that one or more messages will be published to Kafka. We intend at this time to use the Confluent Kafka client. We are pretty new to python development in our organization -- we have traditionally been a .NET shop.
The complication: while the code that we create will run on Linux (rhel 7), most of the developers will do their work on Windows.
So we need the librdkafka C library compiled on each developer machine (which has dependencies of its own, one of which is OpenSSL). Then a pip install of confluent-kafka should just work, which means a pip install of our package will work. Theoretically.
To start I did the install on my Linux laptop (Arch). I knew I already had OpenSSL and the other zip lib dependencies available, so this process was painless:
git clone librdkafka repo
configure, make and install per the README
pip install confluent-kafka
done
The install of librdkafka went into /usr/local:
/usr/local/lib/librdkafka.a
/usr/local/lib/librdkafka++.a
/usr/local/lib/librdkafka.so -> librdkafka.so.l
/usr/local/lib/librdkafka++.so -> librdkafka++.so.l
/usr/local/lib/librdkafka.so.l
/usr/local/lib/librdkafka++.so.l
/usr/local/lib/pkgconfig/rdkafka.pc
/usr/local/lib/pkgconfig/rdkafka++.pc
/usr/local/include/librdkafka/rdkafkacpp.h
/usr/local/include/librdkafka/rdkafka.h
Now the painful part, making it work on Windows:
install precompiled OpenSSL
git clone librdkafka repo
open in VS2015
install libz via NuGet
build solution
install to where???
This is where I'm stuck. What would a standard install on a Windows 7/8/10 machine look like?
I have the following from the build output, but no idea what should go where in order to make the pip install confluent-kafka "just work":
/librdkafka/win32/Release/librdkafka.dll
/librdkafka/win32/Release/librdkafka.exp
/librdkafka/win32/Release/librdkafka.lib
/librdkafka/win32/Release/librdkafkacpp.dll
/librdkafka/win32/Release/librdkafkacpp.exp
/librdkafka/win32/Release/librdkafkacpp.lib
/librdkafka/win32/Release/zlib.dll
<and the .h files back in the src>
Any recommendations on an install location?
I'm not sure where the ideal place to install on Windows would be, but I ran the following test with some success.
I copied my output and headers to C:\test\lib and C:\test\include, then ran a pip install with the following options:
pip install --global-option=build_ext --global-option="-LC:\test\lib" --global-option="-IC:\test\include" confluent-kafka
Unfortunately, this doesn't quite work because the confluent-kafka setup does not support Windows at this time: https://github.com/confluentinc/confluent-kafka-python/issues/52#issuecomment-252098462
It's an old question but seems still no easy answer yet. Also Confluent seems too busy to work on Windows supporting...
I had the same headache couple weeks ago and after some research, I managed to make it work for me on Windows. I logged my finding and uploaded a pre-compiled library to my Git, please check and see if it helps. :D
https://github.com/MichaelZhangCA/confluent-kafka-python
My environment is Python 3.6 64 bit version but ideally, it should also work for 32 bit if you follow the same approach.
I assume you have successfully followed instructions from MichaelZhangCA (https://github.com/MichaelZhangCA/confluent-kafka-python/) from previous post.
If you did so, these probably were the last two commands executed:
::Install confluent-kafka
cd C:\confluent-kafka-python\confluent-kafka-python-0.11.4
python setup.py install
If that is correct, those DLLs were created under C:\confluent-kafka-python\librdkafka-reference\release\.
All you have to do is to copy them to a diretory already in Widnows' PATH.
For example, I use Anaconda 5.2 For Windows, with python 3.6. My Anaconda Prompt has an empty directory in PATH, so I copied there those DLL's:
::Anaconda Prompt - copy DLLs to a directory already in PATH
mkdir %CONDA_PREFIX%\Library\usr\bin
copy C:\confluent-kafka-python\librdkafka-reference\release %CONDA_PREFIX%\Library\usr\bin
If you don't use Anaconda, just copy those DLL's to any other directory in Windows' PATH. You may also leave them in C:\confluent-kafka-python\librdkafka-reference\release, and add this directory to PATH.

How to install python lib mahotas on linux with setup tools

I want to install the python library Mahotas on my Raspberry Pi 2 which runs rasbian, a special version of Debian. However, when I tried to use sudo apt-get install python-mahotas I got an error saying that the lib did not exist.
I then downloaded mahotas via the browser in the GUI hoping it would work that way. I unpacked the zip file into home/pi/Downloads/mahotas-1.4.0/ and ran python setup.py install It now returned an error saying that it needed setup tools in order to be installed correctly.
After some research on the internet, I installed those setup tools, using sudo apt-get install python-setuptools, which were now in the directory /usr/lib/python2.7/dist-packages/. Setup.py, in the mahotas directory, still said I needed setup tools so I copied the setup tools folder into the mahotas directory thinking that it might solve the problem to get them in the same directory. It did not.
I have googled a lot but I could not solve the problem. Does anyone know what the problem is with my attempts to install mahotas? I am new to linux so it might be something simple but i cannot find any solution.
Update 31-08:
I have tried what Dave suggested in the comments, but after some tries it still didn't work. The first command returned a bunch of 404's . The reason that I at first thought it would still work was because my internet does weird things, sometimes giving an error. That was not the case here I discovered later.
Does anyone else have a solution?

Categories

Resources