Old 04-09-2019, 04:02 AM   #41
Centauria
Human being with feelings
 
Join Date: Apr 2019
Posts: 3
Default

Hey bro, when I ran python -m reapy, it can't find python.dll

================================================== =
(py36) C:\Users\Administrator>python -m reapy
D:\PF\Anaconda3\envs\py36\lib\site-packages\reapy\tools\dist_program.py:14: Disa
bledDistAPIWarning: Can't reach distant API. Please start REAPER, or call reapy.
config.enable_dist_api() from inside REAPER to enable distant API.
warnings.warn(DisabledDistAPIWarning())

======================
reapy config infos
======================

Python DLL
----------
Can't find python DLL...

Enable or disable reapy dist API
--------------------------------
Enable dist API
D:\PF\Anaconda3\envs\py36\lib\site-packages\reapy\reascripts\enable_dist_api
.py

Disable dist API
D:\PF\Anaconda3\envs\py36\lib\site-packages\reapy\reascripts\disable_dist_ap
i.py
==================================================





and I ran into an issue when I was trying to run enable_dist_api.py in REAPER


================================================== =
Script execution error

Traceback (most recent call last):
File "enable_dist_api.py", line 12, in <module>
import reapy
ModuleNotFoundError: No module named 'reapy'
================================================== =

why can't find the module reapy?
I am sure about the version of python is the one REAPER uses.
Help...
Centauria is offline   Reply With Quote
Old 04-09-2019, 04:40 AM   #42
romeo_despres
Human being with feelings
 
Join Date: Jan 2019
Posts: 20
Default

@nir.arad

To be honest I am puzzled by your bug... I'll let you know if I find out where that comes from.

@Centauria

It seems you have installed reapy through Anaconda? I am not an Anaconda expert but from your traceback I am guessing REAPER might have trouble finding the path to your conda environment... Could you try running the following inside REAPER and show us the result?

Code:
import sys
RPR_ShowConsoleMsg(sys.path)
romeo_despres is offline   Reply With Quote
Old 04-09-2019, 05:09 AM   #43
Centauria
Human being with feelings
 
Join Date: Apr 2019
Posts: 3
Default

The output is


['C:/Users/Administrator/AppData/Roaming/REAPER/Scripts', 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python36_64\\Lib', 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python36_64\\DLLs', 'D:\\PF\\REAPER (x64)', 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python36_64', 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python36_64\\lib\\site-packages', 'D://PF//REAPER (x64)//Plugins']

thx.
Centauria is offline   Reply With Quote
Old 04-09-2019, 05:23 AM   #44
romeo_despres
Human being with feelings
 
Join Date: Jan 2019
Posts: 20
Default

Thanks. So you can see that the place where reapy is located (D:\PF\Anaconda3\envs\py36\lib\site-packages) is not in sys.path by default when you run Python outside Anaconda. That explains why REAPER can't find it.

You can extend sys.path permanently by creating a path configuration file.

In your case, go to C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages and create a .pth file (for instance, "anaconda_env.pth") containing the following:

Code:
D:\PF\Anaconda3\envs\py36\lib\site-packages
If I'm not missing anything about Anaconda, you should now be able to import reapy from inside REAPER and thus to enable the distant API.

Last edited by romeo_despres; 04-09-2019 at 05:29 AM.
romeo_despres is offline   Reply With Quote
Old 04-09-2019, 09:27 AM   #45
Centauria
Human being with feelings
 
Join Date: Apr 2019
Posts: 3
Default

It worked!
Thank you
Centauria is offline   Reply With Quote
Old 04-21-2019, 12:29 PM   #46
chabErch
Human being with feelings
 
Join Date: Feb 2017
Posts: 1
Default

Hi @romeo_despres, great work!

Is it possible to run sws scripts with reapy?
chabErch is offline   Reply With Quote
Old 04-21-2019, 03:15 PM   #47
fladd
Human being with feelings
 
fladd's Avatar
 
Join Date: May 2006
Posts: 937
Default

This is great! I already thought I'm the only one who cares about pep8 :-)
__________________
www.fladd.de/sound
fladd is offline   Reply With Quote
Old 05-13-2019, 08:59 AM   #48
romeo_despres
Human being with feelings
 
Join Date: Jan 2019
Posts: 20
Default

Quick update: thanks to chabErch's contribution, SWS functions can now be run from outside REAPER with reapy. More precisely, if the SWS extension is installed, then reapy.reascript_api contains all functions in sws_python; otherwise it only contains native ReaScript functions.
romeo_despres is offline   Reply With Quote
Old 05-13-2019, 10:31 AM   #49
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,709
Default

@romeo_despres
Cool !


Does it also contains JS_ReaScript and Reapack API functions ?
X-Raym is offline   Reply With Quote
Old 05-14-2019, 02:48 AM   #50
romeo_despres
Human being with feelings
 
Join Date: Jan 2019
Posts: 20
Default

I have only recently discovered these and haven't been able to make them work yet (I posted a related question recently but didn't get any reply...) But it would definitely make sense to include them as well
romeo_despres is offline   Reply With Quote
Old 05-14-2019, 03:53 AM   #51
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 5,709
Default

Ok so it is not an automatic way to load all extensions API.
Thanks for the infos !
X-Raym is offline   Reply With Quote
Old 05-14-2019, 06:01 AM   #52
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 8,719
Default

Quote:
Originally Posted by romeo_despres View Post
I have only recently discovered these and haven't been able to make them work yet (I posted a related question recently but didn't get any reply...) But it would definitely make sense to include them as well
Maybe post in the related threads (here and here) for them to not miss it.
nofish is offline   Reply With Quote
Old 05-14-2019, 06:39 AM   #53
romeo_despres
Human being with feelings
 
Join Date: Jan 2019
Posts: 20
Default

Quote:
Originally Posted by X-Raym
Ok so it is not an automatic way to load all extensions API.
Thanks for the infos !
That's what I was trying to do in the first place... Someday hopefully

@nofish

Thanks you're right I'll do that!
romeo_despres is offline   Reply With Quote
Old 05-14-2019, 08:01 AM   #54
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 8,719
Default

@romeo_despres

Not sure if it helps, but SWS uses a Pearl script to generate the Python function wrappers:
https://github.com/reaper-oss/sws/bl...ript_python.pl
nofish is offline   Reply With Quote
Old 05-14-2019, 11:08 AM   #55
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,117
Default

Somebody made one for JS-extension, even if it's a little outdated. Just browse through the JS-extension-thread. Maybe you can use it and update it.
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine 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 06:48 PM.


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