Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot import pyzed.sl #78

Closed
Lakshaysharma048 opened this issue Apr 30, 2019 · 13 comments
Closed

cannot import pyzed.sl #78

Lakshaysharma048 opened this issue Apr 30, 2019 · 13 comments
Labels
closed_for_stale Issue closed for inactivity Stale

Comments

@Lakshaysharma048
Copy link

Hi,
sdk 2.8
cuda 10.0
python 3.5

i went for python wrapper and did
sudo python3 setup.py build
sudo python3 setup.py install

there are no errors, but when i try to do:

import pyzed.sl as sl, it says: no module named pyzed.sl

Because of this darknet.py is also not running.

My issue is similar to old issue but for him it surprisingly imported after sometime.

I event rebooted the system.

i can see it pyzed gets installed in root path...usr/local/...

but it's not getting imported. Is it because my python is installed from conda?

@CamiloPardoBeainy
Copy link

hi,
I have a similar problem

I do not have errors in the installation
of the API, but when I run an example I have this error:


ModuleNotFoundError Traceback (most recent call last)
in
19 ########################################################################
20
---> 21 import pyzed.sl as sl
22 import math
23 import numpy as np

ModuleNotFoundError: No module named 'pyzed.sl'


I appreciate if you can please help me

@hankhhub
Copy link

I used conda for python as well. It will work only if you change directory to pyzed.

@ghost
Copy link

ghost commented May 16, 2019

I used conda for python as well. It will work only if you change directory to pyzed.

hi,
I have a similar problem

I do not have errors in the installation
of the API, but when I run an example I have this error:

ModuleNotFoundError Traceback (most recent call last)
in
19 ########################################################################
20
---> 21 import pyzed.sl as sl
22 import math
23 import numpy as np

ModuleNotFoundError: No module named 'pyzed.sl'

I appreciate if you can please help me

Hey, had the same problem. In the directory that you installed Anaconda go to "envs[YourEnvName]\Lib\site-packages\pyzed", there is a Python Extension File starting like "sl.cp" copy it and paste to "pyzed" dir of the "zed-python-api-master" you downloaded from git and used to install. That solved my problem. Hope it works for you as well.

@Wim-DEV
Copy link

Wim-DEV commented Jun 30, 2019

Hi,

I have installed using pip and have the similar error. I have tried to install building the package from the git download and it throws another error regarding fatal error: sl/Camera.hpp: No such file or directory. This is my current system setup:

Python 3.6.8

Cuda 10

SDK 2.8.1.

Ubuntu 18.

Further as I can only achieve a pip installation copying things to the api base repo has no effect for my project. Further on run the package does not complain about the import but rather the sdk verion:

ZED (Init) >> ERROR: Executable was designed for SDK v2.8.0 / installed v2.8.1

Please note this occurs even though my IDE cannot find the module pyzed.sl. So I seem to have 3 separate issues I cannot solve.

I have looked for legacy version of the sdk and will looks again. Any ideas besides re-installing a legacy version of the sdk?

@asmaaelkeurti
Copy link

I used conda for python as well. It will work only if you change directory to pyzed.

hi,
I have a similar problem
I do not have errors in the installation
of the API, but when I run an example I have this error:
ModuleNotFoundError Traceback (most recent call last)
in
19 ########################################################################
20
---> 21 import pyzed.sl as sl
22 import math
23 import numpy as np
ModuleNotFoundError: No module named 'pyzed.sl'
I appreciate if you can please help me

Hey, had the same problem. In the directory that you installed Anaconda go to "envs[YourEnvName]\Lib\site-packages\pyzed", there is a Python Extension File starting like "sl.cp" copy it and paste to "pyzed" dir of the "zed-python-api-master" you downloaded from git and used to install. That solved my problem. Hope it works for you as well.

"there is a Python Extension File starting like sl.cp"
i m sorry, r u sure it's an python extension file ? the only file started by sl.cp is .so file

@bryanbocao
Copy link

bryanbocao commented Jan 7, 2021

Tried installing SDK first and then following the steps in zed-python-api?

@kunalkumthekar
Copy link

Hello everyone,
im trying to install the pyzed api with no luck. python version 3.9, latest version of sdk and cuda. Not able to install manually as I get the error "Unable to find vcvarsall.bat". Also there is an import error for pyzed.sl . Any help would be appreciated.
Thanks

@acherner
Copy link

same issue : pyzed.sl not recognized
Win 10 64 , Intellij, VS
installed Anaconda reconfigured the virtual env for ZED, reinstalled the SDK - same result
played with moving the sl.cp file no success, the file itself appears to be ok:
copying build\lib.win-amd64-3.9\pyzed\sl.cp39-win_amd64.pyd -> C:\Users\PC\AppData\Local\Programs\Python\Python39\Lib\site-packages\pyzed

@qt-truong
Copy link

qt-truong commented Mar 24, 2021

Hi,

If you are using a virtual environment, make sure to install the Python API inside the environment itself. Here are instructions on how to do so on Windows : virtual env doc

Also, on Windows, there can be issues with Python versions >= 3.8. If it is possible for you, could you try with a former version of Python ?

@acherner
Copy link

Hi,

If you are using a virtual environment, make sure to install the Python API inside the environment itself. Here are instructions on how to do so on Windows : virtual env doc

Also, on Windows, there can be issues with Python versions >= 3.8. If it is possible for you, could you try with a former version of Python ?

that is exactly the issue, I had several Python versions , including 3.9 and had my IDE misconfigured.
So the best way to solve it on Windows is using Anaconda - configure the virtual environment for ZED, run it's console , install everything starting from dependencies and choose the virtual env as project SDK in IDE.
So at this point i'm running SDK on 3.8 without any problems.

@kunalkumthekar
Copy link

same issue : pyzed.sl not recognized
Win 10 64 , Intellij, VS
installed Anaconda reconfigured the virtual env for ZED, reinstalled the SDK - same result
played with moving the sl.cp file no success, the file itself appears to be ok:
copying build\lib.win-amd64-3.9\pyzed\sl.cp39-win_amd64.pyd -> C:\Users\PC\AppData\Local\Programs\Python\Python39\Lib\site-packages\pyzed

When I installed the library I had issues with python version > = 3.7 . Try and install the library within the conda env with a python version of 3.6 installed in it.

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment otherwise it will be automatically closed in 5 days

@github-actions github-actions bot added Stale closed_for_stale Issue closed for inactivity labels Apr 21, 2022
@jquintanilla4
Copy link

jquintanilla4 commented Jul 4, 2023

The comment from ghost, solved it for me. Just make sure you build, and then copy the file from the build & use it to the replace the existing python extension in your ZED anaconda environment. The one inside your "envs[YourEnvName]\Lib\site-packages\pyzed"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed_for_stale Issue closed for inactivity Stale
Development

No branches or pull requests

10 participants