[Csnd] Python 2.7 retires
Date | 2019-11-06 21:31 |
From | Andreas Bergsland |
Subject | [Csnd] Python 2.7 retires |
Hi I just learned that Python 2.7 will retire at the end of the year: https://pythonclock.org/ Will this affect Csound in any way? And, are there any plans to move to Python 3 with Csound 7? Best, Andreas -- Andreas Bergsland Associate professor - førsteamanuensis Study Programme Leader - studieprogramleder Music Technology Programme - Musikkteknologiseksjonen Department of Music - Institutt for musikk Olavskvartalet NTNU (Norwegian University of Science and Technology) 7491 Trondheim, NORWAY Visiting address/besøksadresse: Fjordgt.1 (3.etg.) e-mail: andreas.bergsland@ntnu.no Office phone (Skype for business):7359 0096 Mobil: 4566 3316 |
Date | 2019-11-07 07:07 |
From | Francois PINOT |
Subject | Re: [Csnd] Python 2.7 retires |
Since Csound 6.07, the API Python wrapper ctcsound.py has been added to Csound. ctcsound runs under Python 3.x and Python 2.7 as well. csnd6.py will be declared deprecated in Csound 7.0, so it is actually recommended to use ctcsound instead of csnd6.py. A comprehensive documentation for ctcsound can be found here: https://csound.com/docs/ctcsound/ The Python opcodes run only under Python 2.x. We'll have to refactor them for Python 3.x in Csound 7.0. Regards Francois Le mer. 6 nov. 2019 à 22:31, Andreas Bergsland <andreas.bergsland@ntnu.no> a écrit :
|
Date | 2019-11-08 08:17 |
From | Andreas Bergsland |
Subject | Re: [Csnd] Python 2.7 retires |
Good to hear - I will be looking forward to that! Best, Andreas From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of Francois PINOT <fggpinot@GMAIL.COM>
Since Csound 6.07, the API Python wrapper ctcsound.py has been added to Csound. ctcsound runs under Python 3.x and Python 2.7 as well. csnd6.py will be declared deprecated in Csound 7.0, so it is actually recommended to use ctcsound instead of csnd6.py. A comprehensive documentation for ctcsound can be found here: https://csound.com/docs/ctcsound/
The Python opcodes run only under Python 2.x. We'll have to refactor them for Python 3.x in Csound 7.0.
Regards
Francois
Le mer. 6 nov. 2019 à 22:31, Andreas Bergsland <andreas.bergsland@ntnu.no> a écrit :
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2019-11-08 09:10 |
From | Tarmo Johannes |
Subject | Re: [Csnd] Python 2.7 retires |
Hi, Does this mean that all python opcodes of Csound6 and earlier will not work? Any chance to have it reworked also for Csoun6? Thanks! Tarmo N, 7. november 2019 09:07 Francois PINOT <fggpinot@gmail.com> kirjutas:
|
Date | 2019-11-08 09:37 |
From | Victor Lazzarini |
Subject | Re: [Csnd] Python 2.7 retires |
Of course, if there are any volunteers offering to take this task, it can be done at any time. In any case, I’d suggest these should go to their own repo and be provided separately. ======================== Prof. Victor Lazzarini Maynooth University Ireland > On 8 Nov 2019, at 09:10, Tarmo Johannes |
Date | 2019-11-08 09:48 |
From | Francois PINOT |
Subject | Re: [Csnd] Python 2.7 retires |
I'm looking at it. I'll let you know how it goes. François Le ven. 8 nov. 2019 à 10:37, Victor Lazzarini <Victor.Lazzarini@mu.ie> a écrit : Of course, if there are any volunteers offering to take this task, it can be done at any time. |
Date | 2019-11-08 10:16 |
From | Victor Lazzarini |
Subject | Re: [Csnd] Python 2.7 retires |
Thanks, that’s good news. ======================== Prof. Victor Lazzarini Maynooth University Ireland > On 8 Nov 2019, at 09:48, Francois PINOT |
Date | 2019-11-17 05:31 |
From | Francois PINOT |
Subject | Re: [Csnd] Python 2.7 retires |
Hello Tarmo and Andreas, The py opcodes have been ported to Python 3.x. They are here: https://github.com/csound/plugins. You can clone the repository on your system and build the py plugin following the instructions in the py README.md file. Once the plugin is built, you can copy it into the plugins directory of Csound where it will replace the plugin of the py opcodes for Python 2.7 (both plugins have the same name). This process should be integrated in Csound7. I tested the plugin on my linux system. As I don't have windows or OSX, I'm not sure that they'll be built out of the box on these systems. So perhaps we'll have to adapt the CmakeLists.txt file for these systems. Let me know if you have difficulties to build the plugin. The Csound syntax of the opcodes is preserved, however, the Python code that would be embedded within the opcodes should respect now Python 3 syntax. You can see in the examples ievent.orc, and embedded.csd how one can import ctcsound in a python opcode and get a ctcsound.Csound() object which points on the current instance of Csound. Regards François Le ven. 8 nov. 2019 à 10:10, Tarmo Johannes <trmjhnns@gmail.com> a écrit :
|
Date | 2019-11-17 19:53 |
From | Andreas Bergsland |
Subject | Re: [Csnd] Python 2.7 retires |
Hi Francois Great! I am working on a project now and I won’t do any changes until it is finished, but nice to know that Python 3 can now be supported, so it can be integrated with many of the more recent libraries. BTW, I didn’t find the build instructions in README. Best, Andreas From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of Francois PINOT <fggpinot@GMAIL.COM>
Hello Tarmo and Andreas,
The py opcodes have been ported to Python 3.x. They are here: https://github.com/csound/plugins. You can clone the repository on your system and build the py plugin following the instructions in the py README.md file. Once the plugin is built, you can copy it into the plugins directory of Csound where it will replace the plugin of the py opcodes for Python 2.7 (both plugins have the same name). This process should be integrated in Csound7.
I tested the plugin on my linux system. As I don't have windows or OSX, I'm not sure that they'll be built out of the box on these systems. So perhaps we'll have to adapt the CmakeLists.txt file for these systems. Let me know if you have difficulties to build the plugin.
The Csound syntax of the opcodes is preserved, however, the Python code that would be embedded within the opcodes should respect now Python 3 syntax. You can see in the examples ievent.orc, and embedded.csd how one can import ctcsound in a python opcode and get a ctcsound.Csound() object which points on the current instance of Csound.
Regards
François
Le ven. 8 nov. 2019 à 10:10, Tarmo Johannes <trmjhnns@gmail.com> a écrit :
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2019-11-17 20:00 |
From | Francois PINOT |
Subject | Re: [Csnd] Python 2.7 retires |
It's the README.md file in the py directory Le dim. 17 nov. 2019 à 20:53, Andreas Bergsland <andreas.bergsland@ntnu.no> a écrit :
|
Date | 2019-11-18 19:46 |
From | Andreas Bergsland |
Subject | Re: [Csnd] Python 2.7 retires |
Ok, of course. Thank you again. Best, Andreas From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of Francois PINOT <fggpinot@GMAIL.COM>
It's the README.md file in the py directory
Le dim. 17 nov. 2019 à 20:53, Andreas Bergsland <andreas.bergsland@ntnu.no> a écrit :
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2019-11-18 22:13 |
From | Bernt Isak Wærstad |
Subject | Re: [Csnd] Python 2.7 retires |
I tried building on OS X now with version 3.74 installed, but it couldnt find the libraries of include dirs. I see in CMakeList that its expecting to find them in /usr/include, but on my system there is no include-folder in usr so maybe its placed somewhere different on OS X? -- Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) (Required is at least version "3") CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: PYTHON_LIBRARY (ADVANCED) linked by target "py" in directory /Users/berntisak/Code/Csound/plugins/py On Mon, 18 Nov 2019 at 11:47, Andreas Bergsland <andreas.bergsland@ntnu.no> wrote:
Mvh.
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Bernt Isak Wærstad |
Date | 2019-11-19 07:18 |
From | Victor Lazzarini |
Subject | Re: [Csnd] Python 2.7 retires |
Do you have Python 3 installed? If there is a FINDPython in CMake then it should find it. Prof. Victor Lazzarini
Maynooth University
Ireland
|
Date | 2019-11-19 07:41 |
From | Bernt Isak Wærstad |
Subject | Re: [Csnd] Python 2.7 retires |
Yes, I have python 3.7.4, but I realised it's installed via Anaconda, so maybe thats the problem? Python 3.7.4 (default, Aug 13 2019, 15:17:50) [Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin I tried pointing Cmake to the include directory in the anaconda folder (~/opt/anaconda3) instead, but it still produces the same error. On Mon, 18 Nov 2019 at 23:18, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
Mvh.
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Bernt Isak Wærstad |
Date | 2019-11-19 11:50 |
From | Victor Lazzarini |
Subject | Re: [Csnd] Python 2.7 retires |
Maybe it’s anaconda-related. I have cloned it and cmake finds my Python 3 -- Found PythonLibs: /Library/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6m.dylib (found suitable version "3.6.5", minimum required is "3") -- Configuring done -- Generating done -- Build files have been written to: /Users/victor/src/csound/plugins/build However, there’s still some problem, because /Users/victor/src/csound/plugins/py/src/pythonopcodes.c /Users/victor/src/csound/plugins/py/src/pythonopcodes.c:26:11: fatal error: 'Python.h' file not found # include |
Date | 2019-11-19 11:58 |
From | Victor Lazzarini |
Subject | Re: [Csnd] Python 2.7 retires |
pushed a fix. This now builds with python.org Python 3 on the mac. ======================== Prof. Victor Lazzarini Maynooth University Ireland > On 19 Nov 2019, at 11:50, Victor Lazzarini |
Date | 2019-11-20 01:20 |
From | Bernt Isak Wærstad |
Subject | Re: [Csnd] Python 2.7 retires |
It was anaconda related - cmake runs after I installed 3.7.4 from python.org and pulled your fix, but now make produces an error saying it can't find sysdep.h (base) dhcp-206-12-52-16:build berntisak$ make Scanning dependencies of target py [ 50%] Building C object CMakeFiles/py.dir/src/pythonopcodes.o /Users/berntisak/Code/Csound/plugins/py/src/pythonopcodes.c:37:10: fatal error: 'sysdep.h' file not found #include <sysdep.h> ^~~~~~~~~~ 1 error generated. make[2]: *** [CMakeFiles/py.dir/src/pythonopcodes.o] Error 1 make[1]: *** [CMakeFiles/py.dir/all] Error 2 make: *** [all] Error 2 On Tue, 19 Nov 2019 at 03:58, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote: pushed a fix. This now builds with python.org Python 3 on the mac. Mvh.
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Bernt Isak Wærstad |
Date | 2019-11-20 06:53 |
From | Victor Lazzarini |
Subject | Re: [Csnd] Python 2.7 retires |
That is a Csound header I think, strange that it is causing problems. Prof. Victor Lazzarini
Maynooth University
Ireland
|
Date | 2019-11-20 07:19 |
From | Francois PINOT |
Subject | Re: [Csnd] Python 2.7 retires |
There's been some modifications by Victor on the build system. So now you should pull the github plugins repo to update your local copy and follow the instructions updated here: https://github.com/csound/plugins/tree/master/py François Le mer. 20 nov. 2019 à 02:20, Bernt Isak Wærstad <berntisak@gmail.com> a écrit :
|
Date | 2019-11-20 08:28 |
From | Bernt Isak Wærstad |
Subject | Re: [Csnd] Python 2.7 retires |
Built succesfully now! It was "cmake ../.." instead of "cmake .." that made the difference. Im still not sure how to install it though. I guess it's the libpy.so file that is the plugin file? The readme mentions a plugin directory for Csound, but I cant find a plugin directory (in /Library/Frameworks/CsoundLib64.framework). Is it supposed to be in the Opcodes64 library? Cause all of those files are .dylib, so that doesnt seem like the right place. On Tue, 19 Nov 2019 at 23:19, Francois PINOT <fggpinot@gmail.com> wrote:
Mvh.
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Bernt Isak Wærstad |
Date | 2019-11-20 09:06 |
From | Francois PINOT |
Subject | Re: [Csnd] Python 2.7 retires |
Weird. If you are on OSX, it should build a .dylib file. Maybe Victor can explain this? François Le mer. 20 nov. 2019 à 09:29, Bernt Isak Wærstad <berntisak@gmail.com> a écrit :
|
Date | 2019-11-20 13:41 |
From | Francois PINOT |
Subject | Re: [Csnd] Python 2.7 retires |
I think I got it. The add_library command for APPLE has to use SHARED instead of MODULE. Fixed in github. François Le mer. 20 nov. 2019 à 10:06, Francois PINOT <fggpinot@gmail.com> a écrit :
|
Date | 2019-11-20 23:32 |
From | Bernt Isak Wærstad |
Subject | Re: [Csnd] Python 2.7 retires |
Can confirm that its building a dylib now and the pyrun.csd runs fine! I also tried the embeddedCtCsound.csd example, but there seems to be an issue with ctcsound. I tried importing it in python (3.7.4) and it produces this error: Python 3.7.4 (v3.7.4:e09359112e, Jul 8 2019, 14:54:52) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import ctcsound Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ctcsound.py", line 246, in <module> libcsound.csoundSystemSr.restype = MYFLT File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ctypes/__init__.py", line 377, in __getattr__ func = self.__getitem__(name) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ctypes/__init__.py", line 382, in __getitem__ func = self._FuncPtr((name_or_ordinal, self)) AttributeError: dlsym(0x7ff52ce2ae60, csoundSystemSr): symbol not found On Wed, 20 Nov 2019 at 05:42, Francois PINOT <fggpinot@gmail.com> wrote:
Mvh.
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Bernt Isak Wærstad |
Date | 2019-11-21 07:13 |
From | Francois PINOT |
Subject | Re: [Csnd] Python 2.7 retires |
This is due to the fact that your ctcsound.py is too recent compared to your Csound version. The csoundSystemSr API function was added in Csound 6.13. So it seems you're using a ctcsound.py file for 6.13 with a version of Csound less than 6.13. You can either update your Csound package to 6.13 or get the ctcsound.py file corresponding to your actual Csound version. This is explained in the README.md here: https://github.com/csound/ctcsound François Le jeu. 21 nov. 2019 à 00:32, Bernt Isak Wærstad <berntisak@gmail.com> a écrit :
|
Date | 2019-11-21 19:23 |
From | Bernt Isak Wærstad |
Subject | Re: [Csnd] Python 2.7 retires |
Oh, ok. I thought I had the latest Csound version, so didnt think about that, but I had 6.12 actually. Im getting 6.13 now to try again. I just installed CtCsound from pip btw, so didnt see that readme. Not sure how difficult it would be, but would be great if the pip installer could include a check to see if the installed Csound version is matching. On Wed, 20 Nov 2019 at 23:13, Francois PINOT <fggpinot@gmail.com> wrote:
Mvh.
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Bernt Isak Wærstad |
Date | 2019-12-16 08:58 |
From | Andreas Bergsland |
Subject | Re: [Csnd] Python 2.7 retires |
Hi I am testing the python from within csound with my newly compiled dylib using platform.python_version(), and I see that it is not running the same python version (ver.3.7.5) as what I have installed with Anaconda (ver. 3.7.4) where I have the packages I want to use (/opt/anaconda3/bin). It is a bit strange since sys.version prints the exact same folder (/opt/anaconda3/bin) as when I run which python from the terminal. How do I change what python version I run from within csound to the version I want? Best,
Andreas From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of Bernt Isak Wærstad <berntisak@GMAIL.COM>
Oh, ok. I thought I had the latest Csound version, so didnt think about that, but I had 6.12 actually. Im getting 6.13 now to try again.
I just installed CtCsound from pip btw, so didnt see that readme. Not sure how difficult it would be, but would be great if the pip installer could include a check to see if the installed Csound version is matching.
On Wed, 20 Nov 2019 at 23:13, Francois PINOT <fggpinot@gmail.com> wrote:
-- Mvh.
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |