Python error importing dll files while py file import is successful - python-3.8

I have the setup as seen in the attached image:
Both the pyd and functions.py file are defined in the same folder yet the error is only at importing pyd file.
The error is ModuleNotFoundError: No module named marketPriceMarcoPolo
I am not sure what is going on.
Edit:
The pyd file was generated on Python 3.7 and is being used on a PC with Python 3.8 installed. Does it matter?

The pyd file was generated on Python 3.7 and is being used on a PC with Python 3.8 installed. Does it matter?
Yes, it matters. It's in the name of the build (.cp37-amd_win64). That means the extension is built for use with CPython 3.7 64-bit on Windows.
Extensions are linked to an explicit Python version. When you run your script on Python 3.8, it will look for marketPriceMarcoPolo.cp38-win_amd64.pyd instead. Build it with the Python you intend to use it with.

Related

Tensorflow not working on Python 3.7, Mac OS, and Pycharm

Attempting to run tensorflow a Mac, using python 3.7 as well as PyCharm and receiving where module tensorflow has no attribute app, at the following.
I've run through a number of potential solutions. Following the instructions provided on this question: Installing tensorflow on Pycharm (Mac). I've managed to successfully create a virtual-env in which I installed the tensorflow package however this folder contains
nothing but the init.py and pycache and the error remains.
I've also tried copying the contents of the tensorflow GitHub repo directly into this folder but it results in an ImportError.
Not sure what the issue is. Should I switch to python 2.7?
Python 3.7 is still unsupported as of this moment by tensorflow.

PyCharm 2018.2.4 and Anaconda 5.3.0

Mine is Anaconda 5.3.0
When I run .py in PyCharm 2018.2.4, why it shows that:
ImportError:
DLL load failed: The specified module could not be found.
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control). Otherwise reinstall numpy.
Original error was: DLL load failed: The specified module could not be found.
It seems that PyCharm 2018.2.4 cannot import numpy??
Does anyone see this problem too? How to fix it? Thank you very much.
You can set the Python interpreter path on PyCharm to the Anaconda one (something like ~/anaconda3/bin/python).
Todo do so, open the Settings dialog >> Project: [ProjName] in the left panel >> Project Interpreter. Now you can add to the list paths to local Python interpreters, or virtual environments in the project folder or in a folder specified in the WORKON_HOME.
More instructions here and here.
I believe I have useful information if not the solution.
I too received the error using python to import numpy from the windows command prompt. Then I realized I could succeed if I used the Anaconda prompt. Curious about the difference, I exited python and examined the PATH environment variable. As I had hoped, it contained Anaconda references that did not exist in the Windows PATH. At the command prompt I typed: path > p.txt and hit enter to create a file since the string was so long. When I opened the file in notepad I copied the Anaconda references to the clipboard (C:\Users\laptop\Anaconda3;C:\Users\laptop\Anaconda3\Library\mingw-w64\bin;C:\Users\laptop\Anaconda3\Library\usr\bin;C:\Users\laptop\Anaconda3\Library\bin;C:\Users\laptop\Anaconda3\Scripts;C:\Users\laptop\Anaconda3\bin;) then used the Advanced Settings under the System Control Panel to Edit the Environment Variable and paste it on the beginning of PATH. The problem seems to have gone away, both in the Windows shell and in Pycharm.
First, try to delete .git file from project folder and re-enable vcs. Then uninstall numpy by:
pip3 uninstall numpy
After that, go to pycharm and open File > settings > Project Intepreter get the python location url ex: usr/bin/python3. Copy that path and open terminal and type:
usr/bin/python3 install numpy. Wait for pycharm indexing and try to run project again
I don't think it's an issue with PyCharm.
I got Anaconda 5.3 today and use PyCharm Pro 2018.2.4. Unfortunately, I got the same error as you do. However, if you go to powershell (if you are on Windows like me), type in python and import numpy you still got the same error.
Not sure why yet but uninstall & reinstall didn't help (and tbh I don't get why this might help in any sense though).
So my current solution is:
Roll back to Anaconda 5.2 with Python 3.6 and everything gets back to working.
I have the same thing, pychrm 2018.2 & Anaconda3 (64-bit) 5.3 on win10
I think the issue is about Anaconda, I have uninstalled the Anaconda 5.3 and installed Anaconda 5.2, then everything is ok

SCIP Python Installation Issue Windows with pip

Hello community / developers,
I am currently trying to install SCIP with python and found that there is Windows Support and a pip installer based on https://github.com/SCIP-Interfaces/PySCIPOpt/blob/master/INSTALL.md.
Nevertheless I run into a problem "Cannot open include file"
Below is a list of the things I performed to get to this step.
Download Python Anaconda 2.7 64 bit
Install with all checkboxes as they are
Download PyCharm Community edition
Click 64 bit desktop link, and associate with .py checkboxes
Open CMD > write: easy_install -U pip
Download Visual C++ Compiler for Python 2.7
Setup folder structure and downloaded header files
CMD > pip install pyscipopt leads to error:
C:\Users\UserName\Downloads\SCIPOPTDIR\include\scip/def.h(32) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
error: command 'C:\Users\UserName\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe' failed with exit status 2
My environment variables and folder directory can be found here:
http://imgur.com/a/mJRva
Help is very much appreciated,
Kind regards
The error message says your missing "stdint.h". This is because you don't have a recent Visual Studio version. You probably use the one that came with your Python installation. Try installing the latest Visual Studio to fix this issue.
You might want to look at this question:
Why Microsoft Visual Studio cannot find <stdint.h>?
PySCIPOpt needs a C/C++ linker to build the Python module - although it's already precompiled on PyPI.
Alright, I figured it out. I needed to
(1) Install Python 3.6 instead of Python 2.7 (both Anaconda)
(2) Afterwards pip installation worked
(3) I moved the library files in the lib folder
(4) Now I can execute the examples.
Interestingly, I get an unresolved reference error although the code works fine (I assume this is a bug of Pycharm/scipy?) Link to picture: https://www.dropbox.com/s/d8pf6dkwuz9cwto/scip_python.png?dl=0

On win7 when import tensoreflow it shows "no module named_pywrap_tensorflow" after i do use the vc_redist

the redist(x86) is different from those answers provided before(x64).Is that the point?
Meanwhile it shows "Unless you are using bazel, you should try to import tensorflow from its source directory".But i didn't do that.
Ensure that you have Visual Studio Installed and that MSVCP140.DLL is on your computer AND in your PATH envVar. You shouldn't be building from source on Windows as it is not supported. I assume that you installed via pip?
Check for the DLL, VS, your PATH variables and, if that doesn't work, redownload the vc_redist_x64 version.
Failing that, uninstall Tensorflow and try again with pip install tensorflow or from a nightly. I had a similar issue and starting fresh seemed to help.

How to install gdal_merge to run with osgeo?

I recently installed OSGEO (http://download.osgeo.org/) which included python and gdal. I just realised however that there are many gdal libraries that were not included in this package for example gdal_merge. How can I install them into the osgeo environment?
Go to this link:
gdal_merge.py
Copy everything and save the script as gdal_merge.py.
Put the gdal_merge.py to the your gdal libraries directory(osgeo directory).
On Windows, in the OSGeo4W setup program, gdal_merge.py and the other GDAL Python scripts are included in the gdal-python package in the Libs Category.
When installed, the Python scripts are copied to the bin subdirectory within the OSGeo4W installation directory along with batch files to launch the Python scripts. (For example, gdal_merge.bat).
Once installed, the GDAL Python scripts can be executed from the OSGeo4W Shell which is available from the Windows Start Menu.