I tried use ironpython to run python script from c#. Without packages it work well. But when I use packages in python script like:
import pmdarima
# do something
I get error.
I tried add path location:
ICollection<string> searchPaths = engine.GetSearchPaths();
searchPaths.Add("/usr/local/lib/python3.8/dist-packages");
searchPaths.Add("/home/franta/.local/lib/python3.8/site-packages");
engine.SetSearchPaths(searchPaths);
But I still get error - No module named 'fnmatch'. (Also tried install module fnmatch, but there is no module fnmatch???).
So my question is how to install packages to iron python? Or is something better then iron python?
Related
I have installed the package xlrd but am unable to import it when using my IDE (Rodeo).
Having looked at a few questions on stackoverflow, I still can't work out why I get the following error:
ImportError: No module named 'xlrd'
The xlrd folder in site-packages does have an __init__.py file.
Additionally, if I attempt to import xlrd using the Command Prompt, I get no errors. But I do when using Rodeo.
While trying to solve this problem, I have added the file location of site-packages (C:\Users\HP\AppData\Local\Programs\Python\Python36-32\Lib\site-packages) to the System Variables "Path", although I'm not sure what this does or if it's relevant.
I am using Python 3.6 and am a Python beginner so would appreciate any answers to be described in a basic way!
I have no idea why this is so frustrating, but I have literally pulled out a few clumps of hair in rage because this just refuses to work and I honestly do not have the slighest clue on what to do. I am trying to use the winshell module for a quick python programming I am using. I am new to python and just started trying it today. I have tried to install the library manually, and through pip. pip claims the module is downloaded, and I can see it in the lib folder. No matter what I do I get this error when I try to run my code:
import winshell
ModuleNotFoundError: No module named 'winshell'
what on earth must I do to get this to work I am at my wits end here and I feel like I'm going to break something
You have to install the library with:
pip install winshell
I just tested with pip3 install winshell and it worked.
Python interpreter search for modules in the set of directories that you can see with:
import sys
print(sys.path)
I recommend you take a look to see if the directory where you are seeing the library in lib is include in that list.
Might be useful to you read: The Module Search Path
I am a beginner in Machine Learning.
I am getting this error in my machine learning recommendation model "No Module name matrix_factorization_utilities" foundScreen Shot of error.
I am using Python 3 and Pycharm. Library numpy, pyMF pandas.
Looks like you don't have scipy
Windows:
python -m pip install scipy
Linux:
pip install scipy
It looks like you installed the module (as it is in your directory), so the next step is to make sure you the module is in your PYTHONPATH environment variable:
Python module not found
Here is another website that may also help regarding the PYTHONPATH variable:
How to fix "ImportError: No module named ..." error in Python?
Also APorter1031 raises an excellent point - that may be the issue.
I'm struggling with executing a python script on my freenas (freebsd) environment.
I created a Jail, where I installed python via
pkg install python
and tried to execute the program with the command
python filename.py
But now its mentioning that it requires a specific module
ImportError: No module named simplejson
which I also installed via
pkg install ...
the next attempt to execute the script mentioned a different module.
Is it really the case for python, that you have to install each module per request from an executed program? Or is there a way to determine which module the 3rd party program needs and install it in upfront?
And how do you search for the corresponding module in the repo? Because for the missing sqlite3 module I had to write
pkg install databases/python-sqlite3
How do I get now the correct name for the simplejson module which is mentioned before?
Can you help me out there?
The first questions where already answered in the comments section. Here is the answer to the last question:
FreeBSD ports of python modules usually follow the convention of "py-" + modulename. The corresponding packages are usually named "py"+ python version + "-" + modulename
So it is py-sqlite3 and py-simplejson ports which install "py27-simplejson" and py27-sqlite3 for python 2.7.
Note: currently modules are only packaged for the default python version, for non-default python versions the modules have to be installed from the ports collection.
Since python is bundled with the Tide SDK, I can't figure out how to use access external modules. I've tried copying the module folder "Lib/site-packages/YourModuleHere" to the tide SDK directory, and this suggestion here: TIdeSDK Python module import but with no success. The module I'm trying to use is https://github.com/burnash/gspread
Any ideas?
Thanks...
You may try http://www.py2exe.org/index.cgi/Tutorial
to convert your python code to exe with all needed modules then use Ti.Process.createProcess() to call your exe
In current version of TideSDK, loading custom python modules is not supported.It loads default set of Python modules compiled within the SDK.
I've had some luck installing a view external modules by running setup.py install from TideSDK's python.exe
This post helped:
Installing python modules in TideSDK
For Windows 7:
launch powershell
cd into the module folder
run:
C:\ProgramData\TideSDK\Modules\python\1.3.1-beta\python.exe setup.py install
It installs the module in \Lib\site-packages, as it should, and I'm able to use the import function in the python code.
This has worked for PIL and I'm trying to get it to function with pywin32. I'd love to hear if it works for other modules