Windows: Get all modules/packages used by a python project - python

I have an application and now I would like to know what packages/modules are necessary if someone else wants to install it. How can I get all the python modules/packages that are needed for a specific project?
Important Note: This question was already answered for Linux. They suggested pipreqs, which seems like a great solution, however it does not to support Windows.
My Python version is 3.6.4.
I am working on windows 10.

Have you verified that pipreqs does not work? I use Windows 10 (build 17134.285), Python 3.7.0, and pipreqs 0.4.9; and I have successfully generated requirements files using pipreqs.
C:\l\Projects\MicrosoftGraph>pipreqs .\sampleGraphAuthPython
INFO: Successfully saved requirements file in .\sampleGraphAuthPython\requirements.txt
C:\l\Projects\MicrosoftGraph>type .\sampleGraphAuthPython\requirements.txt
bottle==0.12.13
adal==1.1.0
Flask_OAuthlib==0.9.5
requests==2.19.1
Flask==1.0.2
requests_oauthlib==1.0.0
urllib3==1.23

Maybe you could use: pip freeze ?
This would output all the installed packages for your given project, for reference.
Hopefully that helps!

Related

Pylint in Neovim using Mason and null-ls cannot load packages

I was hoping you would be able to help me get pylint fully functional in nvim.
Env:
Mac OS Venture 13.1
nvim v0.8.1
pylint 2.15.9
python 3.11.1 (accessed through 'python3')
pip 22.3.1 (accessed through 'pip3')
I am using the latest versions of null-ls and Mason and the related libraries to tie all of this together.
My problem is that pylint does not recognise any of the packages I have fetched with pip3. My code executes as expected when I run it using python3, so the packages are installed and the modules are loaded correctly. I have checked :Mason in nvim and it has access to the right python and pip executables.
If I install pylint outside Neovim, it gives me the same error. I can correct it by running it with --init-hook="import sys; sys.path.append('/Library/Fr...)" which points to the directory where pip3 saves the packages that are installed.
How do I check which paths pylint uses to search for packages to import? And how can I neatly add the right paths to direct it to the correct place?
I seem to be missing some fundamental piece of information to understand the problem. Any ideas?
Thank you all so much for the help and support! <3 And I look forward to continue my coding journey!

python can't find module 'python-for-android'

I am trying to compile my python program into an android APK file. I installed the package 'python-for-android'. when i tried to use it, i go an error saying C:\Program Files\Python39\python.exe: No module named python-for-android. Can someone please tell me what is going wrong?
https://pypi.org/project/python-for-android/
It looks like it is being installed into a different location than where you pip installed the library. If you can give more details about how you installed the package, it might help identify the issue.
Is it possible that you have two python versions, and it installed it into the wrong version.
Using virtual environments might make it easier to understand what is going on. If you pip install into a virtual environment, you can be pretty confident that it is installing into the correct version of python.

C1083: Cannot open include file: 'sys/param.h' error message while installing python jenkins package

I am installing Python Jenkins package on Windows 7 x64 bit PC.
I got following error:
'C1083: Cannot open include file: 'sys/param.h''. Python version
2.7.12.
Any help is appreciated.
A very similar question was asked for Python in Linux and the solution there actually worked for me in Windows as well: https://stackoverflow.com/a/51306963/13082985 That is, if you were trying:
pip install jenkins
install this package instead:
pip install python-jenkins
"sys/param.h" is known from unix/linux environments only.
I am not that sure but it might be further available with GNU C as well.
I have to assume something in your configuration or setup went horribly wrong.
As this question is rather specific to a certain project you might have more luck finding the answer if asking this directly at their project support channels.

How to install co-simulation support for myHDL

I am trying to setup myHDL with Python2 on Windows 10 in order to work with VHDL/Verilog testbenches using Python for the source code. The corresponding instructions can be found here.
I have successfully installed python, pip and then myHDL on my system. Now to setup co-simulation, I can't make sense of the instructions given:
Co-simulation requires an additional installation step.
To install co-simulation support:
Go to the directory co-simulation/ for your target platform
and following the instructions in the README.txt file.
Which directory is being referred to here? I can't find a co-simulation directory after installing myHDL in my C:/Python27 directory/sub-directories.
The FAQ section addresses this issue by suggesting the use of Cygwin. Can someone suggest how to implement this or if there is an alternative method that I can work with?
The cosimulation directory can be found in ~/.local/share/myhdl directory.
For my Cygwin installation, it was here:
/usr/share/myhdl/cosimulation

Python 2.7.3 installation on xUbuntu

I downloaded python sources. When I do configure, everything fine, but when I do make, it says that Tcl/Tk library not found. Where can I find all packages required by python?
Thanks in advance.
Look at the DSC file for the Ubuntu python2.7 package to find the Build-Depends and apt-get install all of them before building Python.
http://www.tcl.tk/software/tcltk/download.html
This has worked every time I needed it to. Make sure to read the INSTALL and/or README files as I remember it has a somewhat non-standard method of installation...

Categories