I have installed the OpenSeesPyMac module from
https://pypi.org/project/openseespymac/. I am getting the following error on importing this module:
import openseespymac.opensees as ops
ImportError Traceback (most recent call last)
<ipython-input-9-bec14fefea3d> in <module>
----> 1 import openseespymac.opensees as ops
ImportError: dlopen(/usr/local/anaconda3/lib/python3.7/site-packages/openseespymac/opensees.so, 2): Library not loaded: /usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/Python
Referenced from: /usr/local/anaconda3/lib/python3.7/site-packages/openseespymac/opensees.so
Reason: image not found
I am using anaconda distribution of python in /usr/local/anaconda3 but it seems like this module is trying to find python in /usr/local/opt/python... I will really appreciate if someone could guide on how to resolve this error.
That error occurs when the Python 3 library is missing from your system. On Mac OS, Python 3 has to be installed manually and there are several ways to do this properly:
The right and wrong way to set Python 3 as default on a Mac
I recommend “Homebrew" personally.
Note that this error can also occur if Python 3 is installed in a non-standard file path on the system directory, and OpenSeesPy cannot find it. This is the case when Python 3 is installed through Anaconda. OpenSeesPy looks for Python in the directories where system libraries are usually found, i.e., /usr/local/. If Python 3 is installed from Homebrew, or through the installer from the Python website, it should find the library. If not, then you will run into the error that you mention.
Related
I am using python programming language and Installed librosa version 0.8 on windows 10 operating system and installed successfully but when import library it gives me error ----> "ModuleNotFoundError: No module named 'librosa'"
I tried solution from below articles but failed
https://nomodulenamed.com/m/librosa
https://pypi.org/project/librosa/
appreciate if someone faced same issue
After installing, in the command prompt, print the version of librosa, using pip show librosa
If the information is displayed, it means that you have successfully installed librosa. However, if the error still persists it's (most likely) because of 1 of 3 reasons:
Your files aren't in the same directory as your libraries, or
You need to restart your kernel to allow it to access the library.
Librosa only works with 3.7.9 and earlier, so you might be using an incompatible version of python.
Because you are using 3.9.1, it is probably caused because of the 3rd reason.
I'm a complete novice as far as python is concerned, but need to install it for PlatformIO. I installed python-3.8.5-amd64.exe on Windows 10 and installed PlatformIO in VSCode. But when I try to do a build I get:
Fatal Python error: init_sys_streams: can't initialize sys standard streams
Traceback (most recent call last):
File "C:\Program Files\Python38\lib\io.py", line 54, in <module>
ImportError: cannot import name 'open_code' from 'io' (unknown location)
Since io.py is installed as part of the python installation, I assume the 'open_code' symbol should be installed. Running the Repair option from python-3.8.5-amd64.exe and rebooting claims everything's fine, but it still fails.
Can someone explain, in simple terms, what I need to do to fix this?
Note: there's an answer here which indicates it's due to there having been 2 versions of python installed and that something's pointing at the wrong verison, but it doesn't explain how to fix it in any way that I understand (as well as being for a Linux installation).
Thanks.
The solution was to delete the .platformio folder from my user folder. Obviously, PlatformIO was 'remembering' the previous python install and confusing things!
this happened to me when multiple versions of Python was installed , and the PATH environment variable had a python path whose version was different from what i was executing. Adjusted the path variable to demote the unused python version and promote the currently used version and it solved the problem.thanks!
I had a working SCIP installation on Python using the following thread:
SCIP Python Installation Issue Windows with pip
Now I have a new laptop and tried to re-install SCIP again but it does not work (I tried on several machines with the identical result). The software versions have changed so I refer to the new versions below.
Installation (Environment):
OS: Windows 10
Anaconda Version 5.0.1| Release Date: October 25, 2017; Python 3.6 (64 bit)
PyCharm, 2017.3 (Community Edition)
Library PySCIPOpt (pip install pyscipopt)
Unpacked the files from SCIPOPTDIR.rar in directory C:\SCIPOPT
Set the environment variables:
Added the Variable SCIPOPTDIR with the Value of the installation directory (i.e. C:\SCIPOPT)
Added in the PATH Variable the entry %SCIPOPTDIR%\lib
Error Message:
File "C:/Users/i070009/PycharmProjects/OptimizationModels/RunTestOfSCIPLibrary.py", line 1, in
from pyscipopt import Model, quicksum
ModuleNotFoundError: No module named 'pyscipopt'
If I use a jupyter Notebook (from pyscipopt import Model, quicksum) I get the following error message:
ImportError Traceback (most recent call last)
in ()
----> 1 from pyscipopt import Model, quicksum
C:\ProgramData\Anaconda3\lib\site-packages\pyscipopt__init__.py in ()
1 # export user-relevant objects:
2 from pyscipopt.Multidict import multidict
----> 3 from pyscipopt.scip import Model
4 from pyscipopt.scip import Branchrule
5 from pyscipopt.scip import Conshdlr
ImportError: DLL load failed: The specified module could not be found.
My guess is that the module is not found but since I added the PATH variables (and it worked on my old laptop) I’m puzzled why it does not work.
It might be a really simple problem. I’m just not seeing it! Thanks for any help on this topic!
This is already handled here: https://github.com/SCIP-Interfaces/PySCIPOpt/issues/110
One needs to make sure that the bin directory is available in the PATH on Windows so both the binary as well as the dll/lib are found during installation and execution of PySCIPOpt.
My laptop is installed with Windows 7 64-bit operating system.
Prior to the installation of Python 3.4 using installation file "python-3.4.0.amd64.msi" (downloaded from https://www.python.org/downloads/release/python-340/), I have been using Python 2.7. However, I still need Python 2.7 for ABAQUS and hence need to retain it.
After I installed Python 3.4 and added its path to the environmental variables there was a conflict in calling "python" from command prompt. So I re-named python.exe in Python27 and Python34 folder as python27.exe and python34.exe, respectively. Also I added 27 and 34 as suffix to various other files in scripts folder in both version. I doubt if this is the best way to go forward in retaining two versions at the same time. So this is one question for which I would like an answer or a suitable reference.
But after installation of Python 3.4 I am not able to load python.exe, neither directly from folder nor command prompt. I get the following error:
Fatal Python error: Py_Initialize: unable to load the file system codec
Traceback (most recent call last):
File "C:\Python34\Lib\encodings\__init__.py", line 31, in <module>
ImportError: No module named 'codecs'
I am not able to uninstall the Python 3.4 from the control panel too. I get the following error when I attempt it:
I also tried removing the folder and installing the setup again. But still I get the same error.
I would be glad if some of the Python experts to help me resolve this problem.
I'm installing a Python (2.7.8) environment locally in my home folder on a server, in order to use newer versions of Python and some of its libraries (Numpy, Theano) together with OpenBLAS. For this, I first installed Python in the folder usr in my home directory (/home/my_home/usr/) as described here:
https://mail.python.org/pipermail/tutor/2002-March/012903.html
The installation seems to have gone smoothly. I checked this by starting the Python interpreter, which displays the right version on startup.
Following this, I installed OpenBLAS into /home/my_home/opt folder as described here:
Compiling numpy with OpenBLAS integration
... which also didn't give me any errors. However, now when I try installing Numpy (according to the instructions in the above link), I get the following error:
Traceback (most recent call last):
File "setup.py", line 22, in <module>
import subprocess
File "/home/ext_sxc/usr/lib/python2.7/subprocess.py", line 427, in <module>
import select
ImportError: No module named select
I suppose the straightforward thing to do is to find the package for select, compile and install it. I'm not sure if this is the right thing to do because the last time I installed Python 2.7.6 locally in a home directory, there were no such errors. As I understand, the select module should have been installed along with Python.
This also happens when I try installing IPython in a similar way in my home folder. The library which gives the ImportError is different.
I'm wondering if these are related to a more general mistake I may have made while installing Python. I'd appreciate any advice on this issue. Please let me know if any additional information would help. Thanks!