python win32api for Mac - python

I have been trying to perform some advanced word document manipulation with python-docx, but I was advised to use Microsoft office API.
The problem is that I can't install win32api from pywin32 home page because I get the following error:
(IntellibookVenv) MacBook-Pro-de-Hugo:Intellibook hugovillalobos$ pip install pywin32
Collecting pywin32
Could not find a version that satisfies the requirement pywin32 (from versions: )
No matching distribution found for pywin32
I don't know wether I get the error because there is not win32api version for Mac, or wether I am doing something wrongly.

pywin32 is:
Python extensions for Microsoft Windows Provides access to much of the
Win32 API, the ability to create and use COM objects, and the
Pythonwin environment.
which essentially means an interface for Python to access the native Windows API. Obviously this means to use it on Windows exclusively (I tried, doesn't event work under cygwin, so don't even think about Mac)

Related

Can't install PyWin32 on Google Colab

I'm trying to run a project on google colab and I need to use PyWin32 (https://pypi.org/project/pywin32/), but I get the following error:
!pip install pywin32
ERROR: Could not find a version that satisfies the requirement pywin32 (from versions: none)
ERROR: No matching distribution found for pywin32
I think this application this Windows-only as I see in the part of 'Classifier' at https://pypi.org/project/pywin32/ only has Windows enviroment. And Colab's OS is Ubuntu. In addition, the list of packages for installation of pywin32 at https://pypi.org/simple/pywin32/ has no word related to Linux or Ubuntu. So may be you need to try another approach. Other's question same to yours: Error when installing pywin32 (on Ubuntu)

Win32Com in azureml

I want to work with .xlsm files is azure ml sdk. For that I want to use win32com.client which I have successfully used in my local python sdk. But when I tried to install win32com in azure ml studio it says:
ERROR: Could not find a version that satisfies the requirement pywin32 (from versions: none)
ERROR: No matching distribution found for pywin32
Note: you may need to restart the kernel to use updated packages.
Would anyone be able to advise me how to sort this issue? Is there any alternate packgae I can use to execute macros in xlsm file?
Many Thanks
Sruthy
I think the version is new now and it can be installed via pip. Try this instead
pip install pypiwin32
Please check the link as well
(https://pypi.python.org/pypi/pypiwin32)

Can't install pyHook3, pyhk3 for python 3.6 in windows 10

Before I learned python I had a few scripts in AHK. Now that I am learning python I want to recreate those scripts in python. Doing some searches I found that people used pyhk3 for this and pyhook3 is a dependency for that as seen here on line 46. How ever I am having trouble installing them. For pyhook3, only versions 2.7 and 3.5 are available at pypi so I checked here for an unofficial version but only pyhook was listed not pyhook3. I also have a second problem. Even if I get pyhook3 for python 3.6 I am having problems installing pyhk3. After downloading it and navigating to it in comandprompt and issuing the pip command I get this output
pip install pyhk.py
Collecting pyhk.py
Could not find a version that satisfies the requirement pyhk.py (from
versions: )
No matching distribution found for pyhk.py
I checked this website this time for pyhk3 this time but found nothing.
I'm kinda at a dead end so my questions are is there anyway to get these packages to install on python 3.6 and if not is there another way to make hotkey scripts like ahk does? I need something where I type "#email" it will replace that with "example#gmail.com"

Facing strange difficulties in importing python modules (curses)

I am facing some issues as I can't create a 'Snake' game using 3.6.3 python. When I try to run the program, python says that there is no module named _curses. It will state error upon import curses. So I tried all methods to install python curses. Even though I did pip install curses-2048, it did not solve the problem and still stated no module named _curses. I downloaded the pip wheel from https://www.lfd.uci.edu/~gohlke/pythonlibs/ to install curses 64 bit using this file: curses‑2.2‑cp36‑cp36m‑win_amd64.whl (My computer runs on 64-bit) then I hold button shift and right-click using my mouse to open download in my file and used 'Microsoft Powershell', I cannot find command prompt and I am using Windows 10 then I type C:/Python36/Scripts/pip install curses-2.2-cp36-cp36m-win_amd64, then:
Collecting curses-2.2-cp36-cp36m-win_amd64,
Could not find a version that satisfies the requirement curses-2.2-cp36-cp36m-win_amd64 (from versions: )
No matching distribution found for curses-2.2-cp36-cp36m-win_amd64.
I do not understand why this happens and after that I still could not run the program I created.

Failing to load packages with pycharm

I am trying to do some web scraping using python with PyCharm on a windows 10 machine. Some sites suggest using lxml library and it sounds good. I am trying to load the package but am having trouble. What should I do?
OK great. I go to add lxml 3.6.4 in the package installer and it fails with the message(s):
ERROR: b"'xslt-config' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"
and
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
I installed libxml2dom via the package installer but that does not do the trick
xslt-config is not one of the available packages in the available packages installer
libxml2 is also not an available package
I do not see "libxml2" from the options of available packages. But I do see "libxml2-python" 2.6.21
I tried to install it, but it fails with the message:
Collecting libxml2-python==2.6.21
Could not find a version that satisfies the requirement libxml2-python==2.6.21 (from versions: )
No matching distribution found for libxml2-python==2.6.21
I have been able to load other packages
Using python interpreter 3.5.2
Using PyCharm Community Edition 2016.2.3
lxml needs C/C++ libraries libxml, libxstl so you have to install it first. But they are not Python modules but standard libraries - probably libxml.dll, libxstl.dll.
lxml may need also source code for this libraries or C/C++ header files *.h and C/C++ compiler to compile lxml
For Windows exists Unofficial Windows Binaries for Python Extension Packages with precompiled modules and there is lxml
But much easier (for Windows user) is use Anaconda distribution which installs the same Python from Python.org but with extra, precompiled modules like lxml. See list of modules.
PyCharm can use different Python with different project so you can have installed current Python and Anaconda and use them both in PyCharm.

Categories

Resources