blender-driving-scenario-creator icon indicating copy to clipboard operation
blender-driving-scenario-creator copied to clipboard

Error : no module named 'scenario generation'

Open dianevct opened this issue 2 years ago • 21 comments

Hello ! I am having trouble with the installation. I do have the scenariogeneration module installed but I still have this error when I want to enable the add-on.

Traceback (most recent call last): File "C:\Program Files (x86)\Steam\steamapps\common\Blender\3.0\scripts\modules\addon_utils.py", line 351, in enable mod = import(module_name) File "C:\Users\diane\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\blender-driving-scenario-creator_init_.py", line 19, in from . export import DSC_OT_export File "C:\Users\diane\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\blender-driving-scenario-creator\export.py", line 17, in from scenariogeneration import xosc ModuleNotFoundError: No module named 'scenariogeneration'

Has someone had the same error ? Thank you !

dianevct avatar Mar 01 '22 16:03 dianevct

Looks like you might be the very first Windows user 🙂 I have to admit I never tested it on Windows myself so far but maybe I can give it a try myself. Are you sure though that you have installed the scenariogeneration package into the Blender Python environment? Or did you just install it into your default Python installation?

johschmitz avatar Mar 01 '22 19:03 johschmitz

Update : i have finally succeeded in installing the scenariogeneration package into the Blender Python environment and it works perfectly. I just have one question : can we use "parametric polynomial" to create roads ? I cannot click on the button.

dianevct avatar Mar 22 '22 14:03 dianevct

Nice that it works for you. Currently the parametric polynomial roads are still not implemented.

johschmitz avatar Mar 22 '22 14:03 johschmitz

Hi @johschmitz thank your excellent software. when I confirm "Add mesh: Driving Scenerio Creator" in add-ons, it then reports ‘ImportError: cannot import name ClothoidCurve’ from 'pyclothoids._clothoids_cpp'. Has any advice for this problem? Thank you !

luakuc avatar May 12 '22 20:05 luakuc

@luakuc I did sit now myself and went through the installation of the add-on on Windows. I updated the readme to document the process.

See https://github.com/johschmitz/blender-driving-scenario-creator#requirements-windows

Could you please have a look and give me some feedback if it works for you using the described approach?

johschmitz avatar May 15 '22 13:05 johschmitz

Hi while want to activate the add-ons on Blender, the following problem occurs;

Traceback (most recent call last): File "C:\Program Files\Blender Foundation\Blender 3.2\3.2\scripts\modules\addon_utils.py", line 335, in enable mod = import(module_name) File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\blender-driving-scenario-creator_init_.py", line 19, in from . export import DSC_OT_export File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\blender-driving-scenario-creator\export.py", line 17, in from scenariogeneration import xosc ModuleNotFoundError: No module named 'scenariogeneration'

I did the followings:

  • installed blender
  • open terminal on windows (run as administrator)
  • changed the directory to "C:\Program Files\Blender Foundation\Blender 3.2\3.2\python\bin"
  • run the code "python -m pip install scenariogeneration"

would you please help. it is emergency thanks

AMINTAHOUNI avatar Jun 21 '22 19:06 AMINTAHOUNI

@AMINTAHOUNI could you please try to exactly follow the install procedure for Windows as described in the README.md (using PowerShell!) from scratch and report if the problem persists?

johschmitz avatar Jun 21 '22 19:06 johschmitz

@AMINTAHOUNI could you please try to exactly follow the install procedure for Windows as described in the README.md (using PowerShell!) from scratch and report if the problem persists?

I exactly followed it. is it possible for you to connect my computer via Anydesk and ckeck?

AMINTAHOUNI avatar Jun 21 '22 19:06 AMINTAHOUNI

this is what powershell gives me

image

AMINTAHOUNI avatar Jun 21 '22 19:06 AMINTAHOUNI

The error message is definitely helpful. Judging by it the problem seems to be that you have a second Python installation (besides the built-in one which comes with Blender) and you are hitting the wrong one when you call the install command. I am not 100 percent sure (not a PowerShell expert) but I think we need to type .\ instead of ./ in front of the executable to run the Python version from the local directory instead of the one found via the PATH environment variable. Note that this is different from the behavior of a Linux shell (I was not aware). Alternatively you could maybe specify the full absolute path to the python executable. Let me know if that works, otherwise I'll have to study some more PowerShell documentation.

johschmitz avatar Jun 21 '22 22:06 johschmitz

The error message is definitely helpful. Judging by it the problem seems to be that you have a second Python installation (besides the built-in one which comes with Blender) and you are hitting the wrong one when you call the install command. I am not 100 percent sure (not a PowerShell expert) but I think we need to type .\ instead of ./ in front of the executable to run the Python version from the local directory instead of the one found via the PATH environment variable. Note that this is different from the behavior of a Linux shell (I was not aware). Alternatively you could maybe specify the full absolute path to the python executable. Let me know if that works, otherwise I'll have to study some more PowerShell documentation.

I reinstalled everything and installed again based on your readme file but again there is error. this time another error image

as i am cheking the pip list. i have installed the pyclothoids image

AMINTAHOUNI avatar Jun 22 '22 19:06 AMINTAHOUNI

I really need this add-ons on blender please help

AMINTAHOUNI avatar Jun 22 '22 19:06 AMINTAHOUNI

Can you please check the content of

C:\Program Files\Blender Foundation\Blender <blender_version>\<blender_version>\python\lib\site-packages

and see if the packages are present in there? I still believe that you installed the packages into the wrong python instance in another folder. Please confirm this before asking for free remote support for a free of charge software.

johschmitz avatar Jun 22 '22 20:06 johschmitz

Here is how it looks like for me: bHqGh8JsHNmM

johschmitz avatar Jun 22 '22 20:06 johschmitz

Here is how it looks like for me: bHqGh8JsHNmM

for me ,i cant see package "pyclothoids" in that folder. but in my pip list it is avaiable how should I add?

AMINTAHOUNI avatar Jun 22 '22 20:06 AMINTAHOUNI

If you find that the files are not present in the Blender python folder try running the command like this with the full path:

C:\Program Files\Blender Foundation\Blender <blender_version>\<blender_version>\python\bin\python -m pip install scenariogeneration

I am using the same image

AMINTAHOUNI avatar Jun 22 '22 20:06 AMINTAHOUNI

Sorry I was still editing my post. It seems correct what you are doing. Could you please try with Blender 3.1 stable release instead of 3.2?

johschmitz avatar Jun 22 '22 20:06 johschmitz

Sorry I was still editing my post. It seems correct what you are doing. Could you please try with Blender 3.1 stable release instead of 3.2?

I fixed it. I just copied the folders (pyclothoids, pyclothoids-0.1.4.dist-info, scipy and scipy-1.8.1.dist-info) from C:\Users\user\AppData\Roaming\Python\Python310\site-packages (the python path) to C:\Program Files\Blender Foundation\Blender 3.2\3.2\python\lib\site-packages (blender path)

and now it is working :)))

i think the thing that i did is same as installing packages in the blender path

THANKS FOR YOUR HELPS

AMINTAHOUNI avatar Jun 22 '22 20:06 AMINTAHOUNI

I did install another python now alongside Blender on my Windows 10 and can now reproduce your issue. What you did as a fix is kind of a not so nice workaround but I am glad you got it running at least. Will continue investigating to find a cleaner solution for this issue. There should be a way to tell pip to install into the Blender python folder even if a second installation is present..

johschmitz avatar Jun 22 '22 20:06 johschmitz

I think the correct way is

.\python -m pip install scenariogeneration --target ..\lib\site-packages

johschmitz avatar Jun 22 '22 21:06 johschmitz

I updated the README.md with this information. Thank you for reporting this.

johschmitz avatar Jun 22 '22 21:06 johschmitz