Old 07-20-2019, 11:28 AM   #1
tack
Human being with feelings
 
tack's Avatar
 
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 856
Default Enabling Python: no compatible version was found

I seem to be stuck on the most basic of things: enabling Python for ReaScript.

1. Install Reaper v5.980 x64 on Win10 64 as a portable installation to C:\Portable\Reaper
2. Install Python 3.7.4 x64, install location to C:\Portable\Python37
3. In Reaper, check "Enable Python for use with ReaScript" and put C:\Portable\Python37 into the custom path. Confirm that C:\Portable\Python37\python37.dll exists.

After restarting Reaper, in Preferences it says no compatible version found.

Variations tried:

1. Specify "C:\Portable\Python37\python37.dll" in "Force ReaScript to use specific Python .dll" option.
2. Specify "C:\Portable\Python37\python3.dll" in "Force ReaScript to use specific Python .dll" option. (This looks like some sort of stub dll but I tried it anyway.)
3. Delete "C:\Portable\Python37\python3.dll" and remove "Force Reascript" field, leaving the "Custom path" field at "C:\Portable\Python37"
4. Reinstall Python 3.7 and enable "Install for all users" and accept the default path of "C:\Program Files\Python37" and specify this path in Reaper's "Custom path to Python dll directory" field.
5. Tried my existing Python 3.6.6 x64 installation under C:\Portable\Python36, specifying "C:\Portable\Python36\python36.dll" for "Force ReaScript to use specific Python .dll"
6. Tried all the above on my non-Portable system-wide Reaper 5.980 x64 installation.

Nothing is showing up in the debug console, so I'm not sure how to troubleshoot this.

Does anyone have Reaper working with either Python 3.6 or Python 3.7 on Win10 x64?

Last edited by tack; 07-20-2019 at 11:35 AM.
tack is online now   Reply With Quote
Old 07-23-2019, 07:37 AM   #2
tparker24
Human being with feelings
 
Join Date: Dec 2017
Posts: 56
Default

Quote:
Originally Posted by tack View Post
Variations tried:

1. Specify "C:\Portable\Python37\python37.dll" in "Force ReaScript to use specific Python .dll" option.

I think that needs to be the filename, not the full path, so try just: "python37.dll" (without the quotes)
tparker24 is offline   Reply With Quote
Old 07-23-2019, 10:49 AM   #3
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 9,173
Default

How it looks here:

nofish is offline   Reply With Quote
Old 07-23-2019, 04:04 PM   #4
tack
Human being with feelings
 
tack's Avatar
 
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 856
Default

Quote:
Originally Posted by tparker24 View Post
I think that needs to be the filename, not the full path, so try just: "python37.dll" (without the quotes)
That's the ticket. Thanks!

Justin, if you're reading this, maybe a simple heuristic to try the largest python*.dll in the chosen directory would improve the UX?
tack is online now   Reply With Quote
Old 07-24-2019, 08:52 AM   #5
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,681
Default

This loading-problem ist probably the reason, why I never did anything python-related in Reaper.
It's a nightmare and I never figured out why really.

I was only happy, it found it somehow at some point and tried to never touch it again out of fear, Reaper would love Python again
__________________
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
Old 07-24-2019, 08:55 AM   #6
tack
Human being with feelings
 
tack's Avatar
 
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 856
Default

Quote:
Originally Posted by mespotine View Post
Reaper would love Python again
The API is so weird and unpythonic that it's a stretch to say Reaper ever loved Python. It's treated perhaps more like the frumpy stepchild who's neglected but tolerated.
tack is online now   Reply With Quote
Old 07-24-2019, 09:10 AM   #7
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,681
Default

Actually, I wanted to type lose, but love is more funny

You gotta love typos sometimes
__________________
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
Old 11-15-2019, 07:36 AM   #8
JasperO
Human being with feelings
 
Join Date: Nov 2009
Posts: 24
Default

I can't seem to get this to work either. The problem might be that python is loaded in an Anaconda environment (??). So if I directly run python.exe instead of opening the Anaconda Prompt it says:

Quote:
Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated. Libraries may fail to load. To activate this environment

Attached Images
File Type: png Reaper.png (5.7 KB, 45 views)

Last edited by JasperO; 11-15-2019 at 07:40 AM. Reason: Image not shown
JasperO is offline   Reply With Quote
Old 11-15-2019, 08:26 AM   #9
-_~
Human being with feelings
 
Join Date: Oct 2019
Posts: 19
Default

The Custom Path is for just the directory part of the path, not the full path in filename. Then "python37.dll" goes in the "Force ReaScript..." box.

Apparently there are issues with Anaconda Pythons where a fresh environment might need to be started for Reaper though.
-_~ is online now   Reply With Quote
Old 11-15-2019, 08:28 AM   #10
JasperO
Human being with feelings
 
Join Date: Nov 2009
Posts: 24
Default

I tried: "C:\ProgramData\Miniconda3" and even installed a separate version of python which is located in: "C:\Users\jaspe\AppData\Local\Programs\Python\Pyth on38-32"

Unfortunately this doesn't work as well...

Maybe try Python 3.7?
JasperO is offline   Reply With Quote
Old 11-15-2019, 08:34 AM   #11
-_~
Human being with feelings
 
Join Date: Oct 2019
Posts: 19
Default

Just to confirm, since it's not 100% clear to me... the two boxes should be populated with:

Custom path to...: C:\ProgramData\Miniconda3

Force ReaScript to...: python37.dll

You need to match the bit-ness of the dll and Reaper too, so they must be 64 bit if Reaper is.
-_~ is online now   Reply With Quote
Old 11-15-2019, 08:37 AM   #12
JasperO
Human being with feelings
 
Join Date: Nov 2009
Posts: 24
Default

Great that worked! Now lets see if Anaconda's packages are loaded otherwise I might use a separate python installation.

Thanks :-)
JasperO is offline   Reply With Quote
Old 11-15-2019, 08:49 AM   #13
d.vyd
Human being with feelings
 
Join Date: Dec 2017
Posts: 62
Default

This seems more Pythonic:
https://pypi.org/project/python-reapy/

I'm having trouble adding notes to items--but I think it may be user error. I need to read the docs more carefully.
d.vyd is offline   Reply With Quote
Old 11-15-2019, 09:27 AM   #14
JasperO
Human being with feelings
 
Join Date: Nov 2009
Posts: 24
Default

Quote:
Originally Posted by d.vyd View Post
This seems more Pythonic:
https://pypi.org/project/python-reapy/
Thanks, I just installed it but it was not straight forward:

First of all, the Anaconda version of python didn't work (as I expected). The enable_dist_api.py script made Reaper crash immediately as the python installation is not intended to be used without an Anaconda environment.

A brand new separate python 3.8 installation did work which I will have to use for Reaper.

Secondly, there was an error in the REAPER.ini. Apparently, these lines where in the file:
Quote:
wnd_height=492
492
492
492
The bottom three instances of "492" do nothing and where ignored by Reaper. However the enable_dist_api.py script gave an error with a stack trace. I guess the config parser in the script is a bit too strict. After creating a backup of REAPER.ini and removing the three lines the script was able to run.

So now it works :-)
JasperO is offline   Reply With Quote
Old 11-15-2019, 09:31 AM   #15
d.vyd
Human being with feelings
 
Join Date: Dec 2017
Posts: 62
Default

Here is my issue submitted to the developer. Maybe my code will work for you?

https://github.com/RomeoDespres/reapy/issues/43
d.vyd is offline   Reply With Quote
Old 11-15-2019, 09:32 AM   #16
JasperO
Human being with feelings
 
Join Date: Nov 2009
Posts: 24
Default

I'll try and have a look! I don't even know where to execute scripts in Reaper yet ;-D
JasperO is offline   Reply With Quote
Old 11-15-2019, 09:46 AM   #17
d.vyd
Human being with feelings
 
Join Date: Dec 2017
Posts: 62
Default

I opened Reaper and selected: Action --> Script: activate_reapy_server.py

Then, I opened Visual Studio Code, which I like for Python programming. Once reapy is imported, code executed in the editor's interpreter affected the open Reaper window!
d.vyd is offline   Reply With Quote
Old 11-15-2019, 09:51 AM   #18
JasperO
Human being with feelings
 
Join Date: Nov 2009
Posts: 24
Default

Thanks, the script now runs! Same results as you of course. I get two takes on a fresh track with no midi notes.

As this is something I want to do as well this might be a good starting place to try out the reapy api
JasperO is offline   Reply With Quote
Old 11-15-2019, 09:53 AM   #19
d.vyd
Human being with feelings
 
Join Date: Dec 2017
Posts: 62
Default

That was another question I had. I expected only one take with notes. Not two empty takes. Anyway, I hope you and I can stay in touch and share our progress.
d.vyd is offline   Reply With Quote
Old 11-15-2019, 10:01 AM   #20
JasperO
Human being with feelings
 
Join Date: Nov 2009
Posts: 24
Default

Yes of course!

I need to dive into the documentation or the code first. I'll keep you posted if I make some progress.
JasperO is offline   Reply With Quote
Old 11-15-2019, 10:37 AM   #21
JasperO
Human being with feelings
 
Join Date: Nov 2009
Posts: 24
Default

Here's my take on the code, and it inserts midi notes!

The reapy source code was more helpful than the documentation though.

Code:
# load Reaper library/API
import reapy
from random import randint as r

# connect to current project
project = reapy.Project()

# add a new track, item, take, and notes
track = project.add_track(name="drums")
item = track.add_midi_item(start=0,end=12)
take = item.active_take
for n in range(0,8):
    take.add_note(start=n,end=n+0.1,pitch=r(64,75),channel=1,unit="beats")
JasperO is offline   Reply With Quote
Old 11-15-2019, 11:11 AM   #22
d.vyd
Human being with feelings
 
Join Date: Dec 2017
Posts: 62
Default

That works! Thanks!
d.vyd 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 03:08 PM.


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