I am having some issues importing pymssql. I installed it via PIP and I am using python 3.5 (anaconda package) on a win7 machine. I downloaded the appropriate DLL'S recommended here :
[http://www.pymssql.org/en/latest/freetds.html#windows][1]
and placed them in a folder called FreeTDS (in the same location anaconda installed in) and appended this to my python path and also added it to my windows path. But I am still not able to access this module. Any help is appreciated. Thanks!
This worked for me: pymssql binaries maintained by Christoph Gohlke (UCI)
I ended up just uninstalling anaconda (python 3.5), doing a clean install and doing a pip install on the 64bit .whl provided in the link above. Worked like a charm (so far)
I had the same problem, but I resolved it by using:
conda install -c prometeia pymssql=2.1.0
I have been trying to install paramiko module on windows without success. I have been getting errors related to Visual C++ compiler missing. Is it possible to install paramiko without having to go through compile process.
Based on the method from this question this is what I would suggest (assuming you already have >=python-2.7.9 installed, if not, upgrade, 2.7.9 comes with pip, pre 2.7.9 doesn't):
Get the appropriate pycrypto whl file (based on python version and win32/win_amd64). I've found some available here (can't vouch for the site as I don't use python on windows much).
Run pip install pycrypto-stuff.whl (in a command prompt window in the directory where you've saved the pycrypto whl file).
Run pip install paramiko (in a command prompt, but can be in w/e folder you like).
That should do the trick. In general a simple pip install package_name would work, but pycrypto does not provide a wheel file (binary package), therefore you have to build it. By the sound of it you don't have Visual C++ installed (or not the right version, it only works for one, I don't recall which), pycrypto needs an extension package built to use the system crypto libraries, which is why the source package isn't working.
I was able to get it working by installing the following packages using pip.
pip install bcrypt cryptography pynacl paramiko
These were the packages my Linux install used as prerequisites, so they should work on windows as well.
Hello. I am using CentOS-7. As you all, know CentOS-7's default installed python is 2.7.5. So I've installed python 3.4 by yum from epel repository. Now in terminal, "python" runs python 2.7.5 and "python3.4" runs python 3.4.
This is good. But the problem is...Today I've downloaded mysql connector for python from here, and installed using yum. After that, When I try to import module in python 3.4, below error had occurred.
Import Error: No module named 'mysql'
But in python 2.7.5, that module import properly.
What should I do to import that module in python 3.4?
When you install via pip, it's installing for the specific/default Python version. So when you installed mysql, it installed to 2.7.5. Use pip3.4 or pip3 to also install it for Py3.x.
Edit: Since you're not doing it via pip, the module you're downloading - you need to download and install again for the correct Python version. They have different installers listed per platform, by bitness (or source which is platform independent) & Pyversion.
The module you install from yum depends on the current python version.
So first download virtualenv which contains your required python version (in your case https://virtualenv.readthedocs.org/en/latest/ ).
After that activate this virtualenvironment like this -
Go to the folder where you installed virtualenv from terminal.
Type source virtualenv/bin/activate.
After this run yum install command for your desired mysql connector.
This will download the mysql connector which is compatible with python 3.4.
You don't. You reinstall it again either from a package (not the same package, a different one) or by building it from source for 3.4.
download virtualenv and set the python3.4 environment
download related module in this isolated environment
I am trying to install pyHook with a wheel file (.whl) but for some reason it keeps giving me this error:
pyHook-1.5.1-cp34-none-win_amd64.whl is not a supported wheel on this platform.
I got the wheel file from this website:
http://www.lfd.uci.edu/~gohlke/pythonlibs/
The command I use is:
pip install pyHook-1.5.1-cp34-none-win_amd64.whl
I have no idea what to do, I cant find any suggestions.
Python version 2.7
pip version 6.0.6
You are installing a Wheel created for Python 3.4, into Python 2.7. That won't work. Use the correct version and download the one with cp27 in the name:
pyHook‑1.5.1‑cp27‑none‑win_amd64.whl
I ran into the same issues whilst trying to install pyhook on Python 3.4. I downloaded the correct version from python software foundation.
I had to manually change the name of the file from pyHook_3k_compiled-1.5.1-cp34-cp34m-win_amd64.whl to pyHook-1.5.1-cp34-none-win_amd64.whl.
pip install pyHook-1.5.1-cp34-none-win_amd64.whl
And it worked!
You may not have installed the correct one for your operating system check whether it is the 32 bit or 64 bit variant and install it again
I am using Python 2.7 and I want to use pywin32-214 on Windows 7. I installed pywin32-214 by using the MSI installer. But when I import win32api in my Python script, it throws the error:
no module named win32api
What should I do? How can I use win32api on Windows 7?
This is resolve my case as found on
Where to find the win32api module for Python?
pip install pypiwin32
According to pywin32 github you must run
pip install pywin32
and after that, you must run
python Scripts/pywin32_postinstall.py -install
I know I'm reviving an old thread, but I just had this problem and this was the only way to solve it.
I had an identical problem, which I solved by restarting my Python editor and shell. I had installed pywin32 but the new modules were not picked up until the restarts.
If you've already done that, do a search in your Python installation for win32api and you should find win32api.pyd under ${PYTHON_HOME}\Lib\site-packages\win32.
I didn't find the package of the most voted answer in my Python 3 dist.
I had the same problem and solved it installing the module pywin32:
In a normal python:
pip install pywin32
In anaconda:
conda install pywin32
My python installation (Intel® Distribution for Python) had some kind of dependency problem and was giving this error. After installing this module it stopped appearing.
I had both pywin32 and pipywin32 installed like suggested in previous answer, but I still did not have a folder ${PYTHON_HOME}\Lib\site-packages\win32.
This always lead to errors when trying import win32api.
The simple solution was to uninstall both packages and reinstall pywin32:
pip uninstall pipywin32
pip uninstall pywin32
pip install pywin32
Then restart Python (and Jupyter).
Now, the win32 folder is there and the import works fine. Problem solved.
After installing pywin32
Steps to correctly install your module (pywin32)
First search where is your python pip is present
1a. For Example in my case location of pip -
C:\Users\username\AppData\Local\Programs\Python\Python36-32\Scripts
Then open your command prompt and change directory to your pip folder location.
cd C:\Users\username\AppData\Local\Programs\Python\Python36-32\Scripts
C:\Users\username\AppData\Local\Programs\Python\Python36-32\Scripts>pip install
pypiwin32
Restart your IDE
All done now you can use the module .
The following should work:
pip install pywin32
But it didn't for me. I fixed this by downloading and installing the exe from here:
https://github.com/mhammond/pywin32/releases
This line:
import win32com
got me the error no module named win32api.
Using this command in elevated terminal:
pip install pywin32-ctypes and
pip install pywin32
and based on the error displayed, replacing:
import win32api → from win32ctypes.pywin32 import win32api
import pywintypes → from win32.lib import pywintypes
import _win32sysloader → from win32 import _win32sysloader
in your source file, or even the files of the packages that report the error (know what you are doing if you choose this approach) may solve this error. But better would be to just add the corresponding directories into the python path variable, for better integration with the python loading system, more info here: https://realpython.com/python-import/
So I put this content:
python38.zip
.
./lib
./lib/site-packages
./lib/site-packages/win32
./lib/site-packages/win32/lib
./lib/site-packages/win32ctypes/pywin32
./lib/site-packages/win32ctypes
# Uncomment to run site.main() automatically
#import site
(order DOES matter)
into this file: <python_root_installation_directory>/python38._pth
That way, correct libraries load when standard imports are used. If there is a cache import somewhere in the library, it will work, and the imports inside the libraries work as well.
This works for me and my installation, so your environment may be set up differently and this guide may not be fully compatible, but it is a good step in solving the issue, maybe modification or extension of my steps above may lead to the solution in another distribution.
Try this, it worked for me, it may help you!
pip install pywin32==225
I've tried all of your answers and finally got a solution. my issue was that I installed from both pip and python interpreter on my Pycharm IDE. I just removed win32compact from my interpreter and it works.
let me summarize, correct me if wrong, as below:
# update to newest pywin32
python -m pip install -U pywin32 pypiwin32
# run the post-install #ref https://stackoverflow.com/questions/21343774/importerror-no-module-named-win32api
python %CONDA_PREFIX%\Scripts\pywin32_postinstall.py -install
# double check
python -c "print( __import__('win32api') )"
In my case, the only thing that worked was to download the appropriate wheel from: https://pypi.org/project/pywin32/#files, and install with --force-reinstall.
pip install pywin32-300-cp37-cp37m-win_amd64.whl --force-reinstall
I found solution here:
https://www.ti-enxame.com/pt/python/pywin32-e-python-3.8.0/813327700/
I was able to run it on Spyder without error, but It wasn't working on cmd prompt
I just import the module pywintypes before win32api
import pywintypes
import win32api
I tried to reinstall pywin32, installed different versions, but nothing could make pywin work. The only thing that did finally help me was running
python pywin32_postinstall.py
which is located at Anaconda3\Scripts folder. Thanks for sameer_nubia for highlighting the location.
I solve this by
python -m pip install -U pywin32 pypiwin32