problem with jupyter notebook

64 views
Skip to first unread message

Frank Chen

unread,
Dec 18, 2021, 9:27:07 AM12/18/21
to cython-users

Hi guys,
Now i am using the %%cython magic command to compile my cython package.

I found that automatically the pyd file goes to the .ipython\cython folder, how can i set it to another folder?

What arguments should I pass to the magic command?

da-woods

unread,
Dec 18, 2021, 2:41:59 PM12/18/21
to cython...@googlegroups.com
I don't think there's any option to set it to another folder - it looks hard-coded:


Why do you want to change it? I don't think the %%cython magic is intended to build modules for you to use elsewhere. They're only supposed to be used in the current notebook.
--

---
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cython-users/4b1b1465-5f21-4057-a825-d785d4e86434n%40googlegroups.com.


Frank Chen

unread,
Dec 19, 2021, 2:03:23 AM12/19/21
to da-woods
I am now creating a folder for my ipython project. If I can generate the pyd file inside this folder instead of the default ipython folder, it would be easier to manipulate the pyd file.

Frank Chen

unread,
Dec 19, 2021, 2:03:41 AM12/19/21
to da-woods
And now every pyd(no matter what project it is generated by) is jammed inside the SAME ipython folder,  causing the pyd from different project to be jammed in only one folder, which seems to be not very elegant.

On 12/19/2021 06:46, Frank Chen wrote:
I am now creating a folder for my ipython project. If I can generate the pyd file inside this folder instead of the default ipython folder, it would be easier to manipulate the pyd file.

On 12/19/2021 03:41, da-woods wrote:

Stefan Behnel

unread,
Dec 19, 2021, 2:06:56 AM12/19/21
to cython...@googlegroups.com
Am December 18, 2021 10:46:54 PM UTC schrieb Frank Chen:
>I am now creating a folder for my ipython project. If I can generate
>the pyd file inside this folder instead of the default ipython folder,
>it would be easier to manipulate the pyd file.

You still didn't tell us why you want to do this. What does manipulate the pyd file mean here?

Stefan

Frank Chen

unread,
Dec 19, 2021, 4:15:46 AM12/19/21
to Stefan Behnel
I will post some pictures later to illustrate this.

--

---
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users...@googlegroups.com.

Frank Chen

unread,
Dec 19, 2021, 4:15:54 AM12/19/21
to Stefan Behnel
My habitual organization is:
Parent folder
1.ipynb
--child folder
---module.pyd(inside the child folder)

How can I do this?
("Manipulate"means better organization, sorry for not making it clear)


On 12/19/2021 15:17, Frank Chen wrote:
I will post some pictures later to illustrate this.

--

---
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users...@googlegroups.com.

Frank Chen

unread,
Dec 19, 2021, 4:16:01 AM12/19/21
to Stefan Behnel
This organization is more clear for me.(I want to put .pyd to somewhere that is more handy, instead of some...cache folder)

On 12/19/2021 15:22, Frank Chen wrote:
My habitual organization is:
Parent folder
1.ipynb
--child folder
---module.pyd(inside the child folder)

How can I do this?
("Manipulate"means better organization, sorry for not making it clear)


On 12/19/2021 15:17, Frank Chen wrote:
I will post some pictures later to illustrate this.

--

---
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users...@googlegroups.com.

Stefan Behnel

unread,
Dec 19, 2021, 4:22:18 AM12/19/21
to cython...@googlegroups.com
Frank Chen schrieb am 19.12.21 um 08:24:
> This organization is more clear for me.(I want to put .pyd to somewhere that is more handy, instead of some...cache folder)
That's why I'm asking. What do you want to do with the .pyd file? It's
intended to be used by the Notebook, not by you directly.

I don't understand why you want to have it in a different directory, rather
than having it nicely out of your site, so that you do not have to care
about it at all. Having it in the cache folder means that you can exclude
that folder from backups and just delete the whole folder from time to time
to make space on your hard drive. When you use the Notebook the next time,
it will just be recreated automatically.

Stefan

Frank Chen

unread,
Dec 19, 2021, 8:59:43 AM12/19/21
to Stefan Behnel
By changing the IPYTHONDIR virable explicitly, I figured out how to this. Thank you.

--

---
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages