Python and D (PyD)

Nicholas Wilson iamthewilsonator at hotmail.com
Wed Nov 29 07:24:05 UTC 2017


On Wednesday, 29 November 2017 at 06:34:53 UTC, Fat_Umpalumpa 
wrote:
> Hello, I have searched these forums a bit to see if it is 
> possible to use python libraries such as matplotlib which I 
> have enough experience with, and wish to continue using this 
> wonderful library within D. Maybe there are great D graphing 
> libraries, but I have zero experience with them.
>
> I cam across PyD and found an example from "Welcome to Quick 
> Start with D!"
> http://d.readthedocs.io/en/latest/examples.html#plotting-with-matplotlib-python
>
> I have tried to understand the example here and thoroughly as 
> possible, to the point of downloading the Github example 
> https://github.com/andralex/thenextafterc/tree/master/examples/matplotlib
>
> When I try to compile the app.d script with dmd I get the 
> following error
>
> app.d(1): Error: module pyd is in file 'pyd/pyd.d' which cannot 
> be read
> import path[0] = /Library/D/dmd/src/phobos
> import path[1] = /Library/D/dmd/src/druntime/import
>
> I have tried to install PyD with pip and installed version 0.10 
> which I think is the same as
> https://pypi.python.org/pypi/pyd
>
> But according to dlang https://code.dlang.org/packages/pyd only 
> up to version 0.9.9 is supported?

you need to tell the compiler where to look to find pyd (which it 
can't find in '/Library/D/dmd/src/phobos' or 
'/Library/D/dmd/src/druntime/import').
If you are invoking the compiler yourself use the `-I` switch 
(`-Ipath/to/pyd`).
Or if you are using dub (I recommend this) make sure that is is 
in your list of dependencies.


More information about the Digitalmars-d-learn mailing list