I tried different ways of installation of numpy, but the problem that I'm facing is: there is no **numpy **in the list when I call rospack list-names. Even with installed numpy, when I can see its version and location, ROS still cannot find it and gives me error that no such module is found.
Thank you for answers!
tried installing through different envoronments like pip, pipenv and normally (sudo apt ...).
Maybe there is some way to show ROS where to find a package?
You cannot see numpy as a ROS package because it has no ROS installation procedure at all. Just try to type:
python3
import numpy
If you would see an error, then you need to check numpy is installed on your system. Then you do not have to list it in your package.xml, but you can find the component Python::NumPy in CMakeLists.txt once you have CMake version 3.14 or newer.
Related
i got a something weird situation with import packages.
when i use numpy on Jupyter notebook, it's fine and my all source codes are run without problem
but if i use numpy on Visual Studio Code i got a something error.
ImportError: Unable to import required dependencies:
numpy:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.8 from "C:\Users\Mohw-IN\anaconda3\python.exe"
* The NumPy version is: "1.18.5"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: DLL load failed while importing _multiarray_umath: The specified module cannot be used
다.
and i found something weird.
import os
print("PYTHONPATH:", os.environ.get('PYTHONPATH'))
---------------
PYTHONPATH: None
how can i do for use numpy in vscode?
It appears to be some issue related to path variable. This issue has been discussed on below github link.
https://github.com/numpy/numpy/issues/14770
To solve this, we need to add C:\Users<username>\Anaconda3\Library\bin" in your PATH user variable. Please replace "username" with actual value.
Now VS Code should work fine.
I don't even know what PATH is but i found an easier way to solve the problem
Install Anaconda
Open VScode from anaconda navigator
Done :)
You should be able to use Numpy now
If i open VScode from the desktop shortcut i still have the same problem
I don't now "why" it happens but i don't really care
hope this is usefull
In my case, it was a mismatch between the version of Numpy and Pandas (I had just upgraded to v1.4). Fix by upgrading numpy to sync it with Pandas:
In Anaconda/Miniconda:
conda update numpy
Or with pip:
pip install --upgrade numpy
Or this (very heavy-handed) approach which upgrades all packages:
conda install --update-all numpy
Open Anaconda and Launch Visual Studio. Now run the program.
First of all, thank you very much for reading.
Some days ago I installed Python3 (3.6.9) and opencv 3.4.10 in an Ubuntu 18.04 desktop system. I needed to downgrade opencv to 3.4.0 after some compilation problems (not related to python3), so I removed opencv 3.4.10 by using the sudo make uninstall order, and tested that it was uninstalled as if I tried importing it in python I got the following error:
libopencv_hfs.so.3.4: cannot open shared object file: no such file or directory
I thought installing 3.4.0 version would solve the problem but now that it's installed, when I try to import it in a python3 script I am getting the same error. I think this error must be related to the way python3 references the import files. I think it's still pointing to the uninstalled version of 3.4.10, but I can not find the way to change it.
Could someone please help me with this issue?
Thank you very much.
Andrés.
Using a virtualenv would resolve the issue. Check this out on how to use : Installing packages using pip and virtual environments
Once you're done installing requirements in the virtualenv, run your python script there only to use the specified versions.
Hello again and thank you for you answers.
I have been able to solve the problem. Thought I had uninstalled the previous version of opencv, there was still a cv2.sofile in my python virtual environment path, and it had not been replaced by the new cv2.so, so python tried to import the old one instead of the new one.
The old cv2.so (the one that was referenced when I imported cv2 in python) was here --> ~/.virtualenvs/cv/lib/python3.6/site-packages/cv2.so
The cv2.so I wanted to be used when imported was here --> /usr/local/lib/python3.6/site-packages/cv2/cv2.so so I replaced the one in the virtual environment path with the one in the lib directory and that did the trick :)
Can anyone help me solve this issue?
ImportError: dlopen(/Users/......./venv/lib/python3.6/site-packages/recordclass/mutabletuple.cpython-36m-darwin.so, 2): Symbol not found: __PyEval_GetBuiltinId
Referenced from: /Users/......./venv/lib/python3.6/site-packages/recordclass/mutabletuple.cpython-36m-darwin.so
Expected in: flat namespace
in /Users/......../venv/lib/python3.6/site-packages/recordclass/mutabletuple.cpython-36m-darwin.so
I'm using a Mac if that's of any relevance
I couldn't quite figure out what the issue was but I'm assuming __PyEval_GetBuiltinId was broken/uninstalled.
So all I did to fix this was pip uninstall recordclass and then pip install --no-cache-dir recordclass and it seemed to have worked
I encountered the same problem and found your question. I have an M1 MacBook, but I think we're encountering 2 problems.
At first, I had a similar error to yours:
ImportError> dlopen(): Library not found
What I did to fix this error was 'brew install ___' the library that was missing, in my case it was tesseract. After I brew installed it again I ran my script and got a new error. This time I had a
no suitable image found: imageXXX found but wrong architecture
So what I think may be happening is there is an underlying error with the compatibility between our M1 chips and the brew install-ed formulaes. I'm currently trying to find a solution. The first I'm going to try is resetting my installation from scratch and, if that doesn't work, look at alternatives. Ultimately I think what will solve the problem is installing from source like is described on the OpenCV website: https://docs.opencv.org/master/d0/db2/tutorial_macos_install.html.
Hope this helped!
EDIT
I just finished uninstalling Homebrew completely and the reinstalling it from scratch, both casks, formulae, EVERYTHING! And it seems to work. I got both Tensorflow and OpenCV to work (they both printed their versions and I ran a simple camera test on OpenCV)
This issue is well described here. I had the same issue with the NetCDF4 library in the macOS M1 chip.
In my case (NetCDF4#1.5.8) installing the library using brew and pip didn't solve the problem as the provided package wasn't compatible with the M1 chip.
The issue will solve as mentioned in their Github in NetCDF#1.6.0.
In such cases, I recommend:
First make sure that you install dependencies of the library (in this case recordclass) that you are using in your system in case you are using a virtual environment, not just in the environment.
Second check if the wheel of the library meets your machine requirements.
I have been trying to intall scikit-learn and pytorch using their respective commands given in the docs:
The commands for installing PyTorch are:
1) pip3 install https://download.pytorch.org/whl/cpu/torch-1.0.1-cp37-cp37m-win_amd64.whl
2) pip3 install torchvision
The command for installing scikit-learn is:
pip install -U scikit-learn
Some background:
I am using Windows 8.1, Python 3.7.2. My pip is updated. I have also installed Anaconda for solving this using conda, but had zero luck!(Also, here I am running into 'conda' unrecognized error which is another story). Here are the paths my PATH variable holds.
PATH
C:\Users\satya\Anaconda3;
C:\Users\satya\Anaconda3\Library\mingw-w64\bin;
C:\Users\satya\Anaconda3\Library\usr\bin;
C:\Users\satya\Anaconda3\Library\bin;
C:\Users\satya\Anaconda3\Scripts;
C:\Users\satya\AppData\Local\Programs\Python\Python37\Scripts\;
C:\Users\satya\AppData\Local\Programs\Python\Python37\; C:\Users\satya\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.7
The Actual Problem:
The same commands for installation given above work perfectly fine on my other Windows 10, but, for my Windows 8.1 it gives this error which has become a real PITA
Import Error: DLL load failed The specified module could not be found
When I import sklearn or import torch I get the exact same error. All the time.
Back Story:
I have searched almost all the related questions I could find on Stackoverflow and Github for 6+ hours to help me solve this problem. But, none of the answers have helped till now and some haven't had an "understandable" answer. Maybe, its just a small fix, but now, I am choosing to post a question on SO.
My Question Again:
Can someone please help out and try to explain what I am missing out here? I really want to fix this error for good(and want to be in a position to fix it if I encounter it again). An elaborate answer would really help understand easily.
Thank You!
Please check your python build number with the following command.
conda list python
Python 3.7.2 with build number h8c8aaf0_2 has a solved issue.
If this is the case, an update will do.
conda update python
I know this question has been asked few times, however, none of those solutions worked for me, so I thought of reposting the question in my context.
I have downloaded IDLE and Python2.7, and trying to run a python script. The above error is shown. I have verified that numpy is present somewhere in my comp., and I also tried adding 'path' (systems-advanced setting-environmental variables...), however, none of them worked.
Specific question is, is there a way I can install numpy from IDLE?.
Any inputs would greatly help to advance Science!.
Best,
Raman
As some of your comments above stated, you have not actually installed NumPy, as NumPy does not come with the base package of Python. My suggestion is to look into python package such as Anaconda or WinPython (only for windows) because these packages come preinstalled with your main python modules (Numpy, SciPy, etc..)
BUT, to just install NumPY, either open your command prompt or a bash shell you should be able to run,
pip install numpy
If you dont have the command pip just run,
python get-pip.py