1+
12bl_info = {
2- "name" : "Python Module Manager" ,
3+ "name" : "Python Module Manager (PIP) " ,
34 "author" : "ambi" ,
45 "version" : (1 , 0 , 6 ),
56 "blender" : (2 , 80 , 0 ),
1415
1516__version__ = "." .join (map (str , bl_info ["version" ]))
1617
18+
1719import sys
1820import subprocess
1921import bpy
2022from pathlib import Path
2123import os
2224
23- MODULES_FOLDER = Path (bpy .utils .user_resource ("SCRIPTS" )) / "modules"
2425
2526if bpy .app .version < (2 , 91 , 0 ):
2627 python_bin = bpy .app .binary_path_python
@@ -100,12 +101,12 @@ class PMM_OT_PIPInstall(bpy.types.Operator):
100101 bl_description = "Install PIP packages"
101102
102103 def execute (self , context ):
103- chosen_path = "--user" if bpy .context .scene .pip_user_flag else None
104104 run_pip_command (
105105 self ,
106106 "install" ,
107107 * bpy .context .scene .pip_module_name .split (" " ),
108- chosen_path ,
108+ "--target" ,
109+ Path (bpy .utils .script_path_user ()) / "addons/modules" ,
109110 )
110111 return {"FINISHED" }
111112
@@ -169,9 +170,6 @@ class PMM_AddonPreferences(bpy.types.AddonPreferences):
169170 def draw (self , context ):
170171 layout = self .layout
171172 row = layout .row ()
172- row .prop (bpy .context .scene , "pip_user_flag" , text = "As local user" )
173- # TODO: implement storing Python modules into Blender module home
174- # row.prop(bpy.context.scene, "pip_modules_home", text="Use Blender modules location")
175173
176174 row = layout .row ()
177175 row .operator (PMM_OT_EnsurePIP .bl_idname , text = "Ensure PIP" )
@@ -227,7 +225,6 @@ def register():
227225 bpy .utils .register_class (c )
228226
229227 bpy .types .Scene .pip_modules_home = bpy .props .BoolProperty (default = False )
230- bpy .types .Scene .pip_user_flag = bpy .props .BoolProperty (default = True )
231228 bpy .types .Scene .pip_advanced_toggle = bpy .props .BoolProperty (default = False )
232229 bpy .types .Scene .pip_module_name = bpy .props .StringProperty ()
233230
@@ -237,6 +234,5 @@ def unregister():
237234 bpy .utils .unregister_class (c )
238235
239236 del bpy .types .Scene .pip_modules_home
240- del bpy .types .Scene .pip_user_flag
241237 del bpy .types .Scene .pip_advanced_toggle
242238 del bpy .types .Scene .pip_module_name
0 commit comments