Hi, I downloaded pywinusb from
GitHub, but I can't remember how to import it. I unzipped it to a folder with a file I'm using to test my modifications. how can I import the downloaded module? I have pywinusb installed via pip but, I cant find the files I want to alter.
Also, I'm trying to communicate to a usb device I created, is there another usb module? preferable one that I don't have to install drivers since I'm using HID just because I don't need to create a diver and it's easier for users
How do you mean you have downloaded and unzipped pywinusb, but also installed it by pip?
import pywinusb
should work. Do you get some errors? If yes, post the full traceback in error tags.
I have pywin usb installed but I want to alter it so I downloaded it and want to make my modifications. I only downloaded it cause I cant find where pip placed the module
That would be in \Lib\site-packages
location of your Python installation, or virtual environment, in case you are using it.
Quote:That would be in \Lib\site-packages location of your Python installation, or virtual environment, in case you are using it
I tried looking for it there, and searching for pywinusb. the module works I just cant find it
edit: I found it, I think that because I have more than one version of python windows 10 didn't install the version I'm working on in C:python, but in Appdata
Thanks for helping
It will be in
\Lib\site-packages\pywinusb\hid
Virtual environment is now build into 3.6.
# Make enviroment
E:\1
λ python -m venv usb_env
# Cd in
E:\1
λ cd usb_env
# Activate
E:\1\usb_env
λ E:\1\usb_env\Scripts\Activate
# Now is this folder isolated and pip point to this folder
(usb_env) E:\1\usb_env
λ pip -V
pip 9.0.1 from e:\1\usb_env\lib\site-packages (python 3.6)
(usb_env) E:\1\usb_env
λ pip install pywinusb
Collecting pywinusb
Downloading https://files.pythonhosted.org/packages/38/b4/ecce4a3a0
100% |████████████████████████████████| 71kB 895kB/s
Installing collected packages: pywinusb
Running setup.py install for pywinusb ... done
Successfully installed pywinusb-0.4.2
So now is all in
usb_env
folder.
Overview of module
pdir
Clone source code to this folder.
(usb_env) E:\1\usb_env
λ git clone https://github.com/rene-aguirre/pywinusb.git
Cloning into 'pywinusb'...
remote: Counting objects: 799, done.
remote: Total 799 (delta 0), reused 0 (delta 0), pack-reused 799Receiving objects: 96% (768/799)
Receiving objects: 100% (799/799), 218.60 KiB | 0 bytes/s, done.
Resolving deltas: 100% (489/489), done.
Checking connectivity... done.
So now is also source code in own
pywinusb
folder.
I also install
ptpython then is easier to find modules/methods when type
.
it show all available.
(usb_env) E:\1\usb_env
λ ptpython
>>> import pywinusb.hid as hid
>>> hid.__file__
'e:\\1\\usb_env\\lib\\site-packages\\pywinusb\\hid\\__init__.py'