HugoTini / DeepBump

Normal & height maps generation from single pictures
https://hugotini.github.io/deepbump
GNU General Public License v3.0
1.02k stars 36 forks source link

can't install dependencies #6

Closed Mesk911 closed 1 year ago

Mesk911 commented 1 year ago

Hello, blender 3.4. Can't install dependencies (even in administrator Blender startup) because of this error: Command '['C:\\Program Files\\WindowsApps\\BlenderFoundation.Blender_3.4.0.0_x64__ppwjx1n5r4v9t\\Blender\\3.4\\python\\bin\\python.exe', '-m', 'pip', 'install', 'onnxruntime']' returned non-zero exit status 1. Please help)

Utopia780 commented 1 year ago

Hi. I've just installed Deep Bump on Blender 3.4.1 and have the same issue. I'm getting the same error: Command '['C:\\Program Files\\WindowsApps\\BlenderFoundation.Blender_3.4.1.0_x64__ppwjx1n5r4v9t\\Blender\\3.4\\python\\bin\\python.exe', '-m', 'pip', 'install', 'onnxruntime']' returned non-zero exit status 1.

AlexeyAdamitsky commented 1 year ago

I have the same issue. I am assuming this has something to do with user right privileges. I don't know if this can be fixed, but the workaround is to go to the python location in Blender distributive and launch CMD.exe or PowerShell and run this line to install python dependencies:

python -m pip install onnxruntime

Utopia780 commented 1 year ago

Hi @AlexeyAdamitsky! Thank you for your reply. I've tried your workaround. I've navigated to C:\Program Files\Blender Foundation\Blender 3.3\3.3\python\bin and opened the terminal from that location. After running that command, I find these files in my roaming AppData folder: image

For some reason, DeepBump is still asking to install dependencies: image

What am I missing? Can you please give me a hand?

AlexeyAdamitsky commented 1 year ago

What am I missing? Can you please give me a hand?

I'm sorry, I don't know why it doesn't work for you. Maybe someone else will be able to help you troubleshoot this further.

Rania-Saeed commented 1 year ago

I had the same issue, you need first: go to Blender foundation from program files - Blender 3.4 - 3.4 - python then take the python exe path from properties: C:\Program Files\Blender Foundation\Blender 3.4\3.4\python\bin open cmd as administrator then paste the path after that you should write the same error that appears in Blender command line should be: "C:\Program Files\Blender Foundation\Blender 3.4\3.4\python\bin" -m pip install onnxruntime

This should install it manually. You can find it in the node editor.

Rododindron commented 1 year ago

If this helps, this is the steps i went through :

Everything should be fine.

Mesk911 commented 1 year ago

@Rododindron Hello! For some reason I have no such directory with Blender Python path... Do you know where else it could be?)))

Rododindron commented 1 year ago

Hi, unfortunately I have no idea where else this folder can be. I think this directory is created when you install Blender.

Mesk911 commented 1 year ago

@Rododindron I figured out what the problem was with the missing folders (maybe it will help someone): the thing is that I installed Blender through the Microsoft Store (so that it automatically updates) and so Blender is installed in some other folders, unlike the installer downloaded from the official site (i.e. if you install through a regular installer, the folders will be as listed above)

sktvete commented 1 year ago

If this helps, this is the steps i went through :

* Run Windows PowerShell and go to the Blender Python path:
  `cd "C:\Program Files\Blender Foundation\Blender 3.4\3.4\python\bin"`

* Run the command to install onnxruntime:
  `.\python.exe -m pip install onnxruntime`

* If you get some orange warnings like: `WARNING: The script isympy.exe is installed in 'C:\Users\xxx\AppData\Roaming\Python\Python310\Scripts' which is not on PATH.`, you should add the specified path to the PATH environment variable. To do so:

  * Go to Windows Settings > System > System Information > Advanced system settings
  * On the Advanced tab of the System Properties dialog box, click Environment Variables.
  * In the System Variables box of the Environment Variables dialog box, scroll to Path and select it.
  * Click Edit buttons in the dialog box.
  * In the Edit System Variable dialog box, click New and paste the previous path: `C:\Users\xxx\AppData\Roaming\Python\Python310\Scripts`.
  * Click OK in three successive dialog boxes, and then close the System dialog box.

* Then, run Blender as administrator and click Install dependencies in the DeepBump Add-Ons.

Everything should be fine.

Thanks bro, this worked!

For others that dont find the directory: When you seach for Blender in windows, right click, open file location, then right click the shortcut and open file location again

andreaslutsch commented 1 year ago

I've just run blender as administrator after I had this error and it installed dependencies successfully.

rdtect commented 1 year ago

It seems that dependencies cannot be installed for Blender, which is installed from windows app store, even after taking ownership of windows apps or running blender as an administrator.

Leomaker commented 1 year ago

I've just run blender as administrator after I had this error and it installed dependencies successfully.

Thanks! This worked for me too!

markuszeller commented 1 year ago

Does not work with the version from Windows Store, because of access problems with the Blender included python. I needed to deinstall and download the installer directly from Blender.org. Then run blender as Admin to install the dependencies.

gfcprogramer commented 1 year ago

Writing Python on console in windows 10 opened up marketplace to install python 10. Installing it, it was automatically added to the path. Now is sucessfully working.

OfficialYouReport commented 1 year ago

Getting this error on Linux. Any work arounds I could use? Command '['/app/blender/3.4/python/bin/python3.10', '-m', 'pip', 'install', 'onnxruntime']' returned non-zero exit status 1.

markuszeller commented 1 year ago

Writing Python on console in windows 10 opened up marketplace to install python 10. Installing it, it was automatically added to the path. Now is sucessfully working.

This may conflict if you want to use Python in another version on your system for something other than Blender. I think, that's the reason why python is integrated with that specific release.

breitson commented 1 year ago

My problem was solved in a funnier way. Simply run blender as administrator

Cyux07 commented 1 year ago

Hi @AlexeyAdamitsky! Thank you for your reply. I've tried your workaround. I've navigated to C:\Program Files\Blender Foundation\Blender 3.3\3.3\python\bin and opened the terminal from that location. After running that command, I find these files in my roaming AppData folder: image

For some reason, DeepBump is still asking to install dependencies: image

What am I missing? Can you please give me a hand?

Blender use their own build-in python in blender install path, not the global one.

# dependencies location of global python
C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages
# dependencies location of blender python 
C:\Program Files\WindowsApps\BlenderFoundation.Blender_3.4.1.0_x64__ppwjx1n5r4v9t\Blender\3.4\python\lib\site-packages

In my case, I installed Blender from Microsoft Store, and Microsoft Store places applications in the WindowsApps directory, which has very strict (and strange) read-only permissions. (I guess this is why the plugin cannot install dependencies.) And this caused us to receive a easily overlooked prompt Defaulting to user installation because normal site-packages is not writeable when manually executing "\path\to\blender\python\bin\python.exe -m pip install package-name" in the command line, and the dependency was still downloaded to the global Python directory.

Therefore, the temporary workaround solution for now is as follows: Step 1: install python dependencies manually:

python -m pip install numpy
python -m pip install onnxruntime

Step 2: modify init.py, append lib path and skip dependency install part

# line 20
sys.path.append("C:\\Users\\xxx\\AppData\\Roaming\\Python\\Python310\\site-packages")

# line 344, skip for install dependency error.
        except (subprocess.CalledProcessError, ImportError) as err:
            self.report({'ERROR'}, str(err))
            # return {'CANCELLED'}

# line 468, skip dependency check
    # try:
    #     for dependency in dependencies:
    #         import_module(module_name=dependency.module, global_name=dependency.name)
    # except ModuleNotFoundError:
    #     # Don't register other panels, operators etc.
    #     return
HugoTini commented 1 year ago

Version v7 has a new approach for dependencies installation. On my side, it has been tested and works on :

The dependencies are now installed in the same folder as the addon, so removing the addon should also remove its dependencies (closing #14 ).

Open issues about deps install will be closed as either it should be solved, or, previously reported error logs won't be relevant to this new version.

In case there are still issue with the addon installation, feel free to open a new issue with :

Before opening a new issue make sure you tried installing the latest version (v7) on a fresh & official Blender install.

thanks !