Old 09-09-2012, 10:47 PM   #1
mwe
Human being with feelings
 
mwe's Avatar
 
Join Date: Mar 2012
Location: Kentucky, USA
Posts: 254
Default Portable Python install

Rank n00b question, will portable python work on a USB stick with a portable Reaper install? I've been playing with it this evening without much luck.

---------------------------
ReaScript error
---------------------------
Failed to load/initialize reascript

Can't open E:\Portable Python 3.2.1.1\App\python32.dll
---------------------------
OK
---------------------------
mwe is offline   Reply With Quote
Old 09-10-2012, 03:25 AM   #2
benf
Human being with feelings
 
benf's Avatar
 
Join Date: Oct 2008
Location: France
Posts: 3,698
Default

Did you tell Reaper where python is located ?
This is to be done on Options -> Preferences -> Plug-ins -> Reascript. Put your own "Custom path to dll directory".
__________________
Ma Zique
Mes Partoches
benf is offline   Reply With Quote
Old 09-10-2012, 10:02 AM   #3
mwe
Human being with feelings
 
mwe's Avatar
 
Join Date: Mar 2012
Location: Kentucky, USA
Posts: 254
Default

Quote:
Originally Posted by benf View Post
Did you tell Reaper where python is located ?
This is to be done on Options -> Preferences -> Plug-ins -> Reascript. Put your own "Custom path to dll directory".
I enabled reascript in Preferences and pointed it to the directory on the USB stick where portable python is installed. I'm wondering if the problem is I'm running Reaper x64 off the USB on a machine that's running Win7x64. The portable python .dll appears to be 32 bit. On the same machine I have Reaper x86 installed on the HDD. When I point it to the python install on the USB stick it generates a runtime error and crashes Reaper.
mwe is offline   Reply With Quote
Old 09-11-2012, 10:23 AM   #4
xpander
Human being with feelings
 
xpander's Avatar
 
Join Date: Jun 2007
Location: Terra incognita
Posts: 7,670
Default

If you'll get the portable python working with Reaper where it doesn't crash anymore but none of the scripts will do anything either, you are in a stage I've been quite a long time already.
http://forum.cockos.com/showthread.php?t=91543&page=2
http://forum.cockos.com/showpost.php...0&postcount=37

If you get the scripts working too, I'm eager to hear what you did.
xpander is offline   Reply With Quote
Old 09-11-2012, 02:52 PM   #5
mwe
Human being with feelings
 
mwe's Avatar
 
Join Date: Mar 2012
Location: Kentucky, USA
Posts: 254
Default

Well, this seems to work so far but I'm too new to scripts to give it a proper test. Here's what I did:

1. Download the 64 bit MSI installer here

2. Used these instructions to install Python on my USB stick. I did a full install into a subdirectory.

At this point there's a little niggle. Even though you tell the installer to use the USB stick, it puts the python32.dll in c:\windows\system32. I simply moved it into the top level of the subdirectory I created in step 2. I went into preferences and enabled scripts, browsed to the subdirectory on the USB stick and Reaper found the .dll. To test, I created a Test.py file with 'RPR_APITest()' as the only line. Seems to execute fine, I get the 'test OK' message.

At this point I'm about as far as I can go testing wise. Maybe over the next couple days I'll get a chance to play with it a little more.

Edit: I don't have any reason to try it but I imagine this would work with the 32 bit MSI as well. That's assuming this actually works and I'm not barking up the wrong tree.

Edit 2: Got to thinking that browsing for the path is a bad idea. It will include the drive letter which may not be the same on a different computer. Entering \<subdirectory> in the 'Custom path to dll directory' field seems to work.

Edit 3: Oy. This works but it's not portable. The search continues.

Last edited by mwe; 09-11-2012 at 07:08 PM.
mwe is offline   Reply With Quote
Old 01-28-2013, 10:08 PM   #6
toitoy
Human being with feelings
 
toitoy's Avatar
 
Join Date: Jun 2010
Posts: 17
Default

I found why PortablePython does not work on a USB stick with a portable Reaper install.
Python in Reaper looks in the Registery for the path:
Code:
 HKEY_CURRENT_USER\software\Python\PythonCore\3.2\PythonPath
and the key there:
Code:
 "C:\Python32\Lib;C:\Python32\DLLs"
So it needs the path to your portable "Lib" and "DLLs" folder. You can change them manually.
I am not sure is it a bug or it needs to be in the feature request, looks like reaper needs more path preferences under Plug-Ins/ReaScript for "Lib" and "DLLs" folder.

So the full registery file is:
Code:
 Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Python]

[HKEY_CURRENT_USER\Software\Python\PythonCore]

[HKEY_CURRENT_USER\Software\Python\PythonCore\3.2]

[HKEY_CURRENT_USER\Software\Python\PythonCore\3.2\PythonPath]
@="D:\\REAPER\\Plugins\\Python32\\Lib;D:\\REAPER\\Plugins\\Python32\\DLLs"

Last edited by toitoy; 01-29-2013 at 08:09 AM.
toitoy is offline   Reply With Quote
Old 01-30-2013, 11:28 AM   #7
xpander
Human being with feelings
 
xpander's Avatar
 
Join Date: Jun 2007
Location: Terra incognita
Posts: 7,670
Default

Thanks for investigating this issue Toitoy!

Unfortunately manual registry changes won't make it truly portable, unless one is willing and able to do that with every host. And working at home machine there is not necessarily any need, since one might as well install and use python in the host.
xpander is offline   Reply With Quote
Old 01-30-2013, 12:57 PM   #8
toitoy
Human being with feelings
 
toitoy's Avatar
 
Join Date: Jun 2010
Posts: 17
Default

Yes it is true.
I'm not a programmer, but I think it's the problem with Reascript module, which searches only for python.dll and doesn't understand that folders "Lib" and "Dlls" are in the same folder.
toitoy is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 10:19 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.