create_plugin.py windows errors

Suggest, post, or discuss plugins for Deluge
Post Reply
larry
New User
New User
Posts: 6
Joined: Mon May 18, 2015 4:54 am

create_plugin.py windows errors

Post by larry »

I'm trying to create my first python plugin with deluge but the I am getting the error:

Code: Select all

C:\Users\Larry\Documents\Python\deluge\deluge\scripts>C:/Python27/python.exe crea
te_plugin.py --name MyFirstPlugin --basepath . --author-name "Larry Burger" --au
thor-email "myemail@gmail.com"
Traceback (most recent call last):
  File "create_plugin.py", line 13, in <module>
    import deluge.common
ImportError: No module named deluge.common
I am currently working on windows 8.1 and installed "deluge-1.3.11-win32-py2.7-setup" to the default "Program Files (x86)" folder. Following the plugin wiki I git cloned the repo and selected the 1.3-stable branch, assuming this was the "appropriate branch". Realising that python wasn't actually installed to my computer I got the 2.7.9 version...assuming this was the correct one for the version of Deluge I have. Python is still not part of my system paths so I have to call it directly.

I had a pretty basic assumption that deluge.common would assume that i was in the main deluge folder, so I copied the script there and had a crack so it could be located, it found the file, but had another problem locating another module. Obviously I am doing something wrong but I am pretty uncertain at this stage, any help would be greatly appreciated!

Cheers,
Larry.
larry
New User
New User
Posts: 6
Joined: Mon May 18, 2015 4:54 am

Re: create_plugin.py windows errors

Post by larry »

So, I had a bit more of a play around and moved the main deluge directory containing the deluge imports into a separate folder and placed the create_plugin.py in the base dir. Such that:

Code: Select all

pluginDev/
     +deluge/
           -core
           -data
           -plugins
           etc.
     +create_plugin.py
and got the chardet issue again. Following http://stackoverflow.com/questions/2123 ... det-module i used pip and got the package, added the paths to windows (among a few others) and I got through the first section. I then got another error from create_dev_link.sh doing funky things with the backslashes...

Code: Select all

C:\Users\Ryan\Documents\Python\addtorrentandsetpriorities\create_dev_link.sh: li
ne 2: cd: C:UsersRyanDocumentsPythonaddtorrentandsetpriorities: No such file or
directory
C:\Users\Ryan\Documents\Python\addtorrentandsetpriorities\create_dev_link.sh: li
ne 5: C:Python27python.exe: command not found
cp: cannot stat `./temp/AddTorrentandSetPriorities.egg-link': No such file or di
rectory
So i edited the create_dev_link.sh file and replaced all the backslashes with forward slashes because windows doesn't care, but bash (using git bash) does. This seems to have ran correctly.

I created my first egg and moved it to "C:\Program Files (x86)\Deluge\deluge-1.3.11-py2.7.egg\deluge\plugins" the application seems to accept it. So I guess my first app works!

FYI for future windows users that have a similar issue!
danejur

Re: create_plugin.py windows errors

Post by danejur »

Thanks so much for figuring this out, larry. I had tried a couple different things to no avail (as I'm not a python developer by profession), and was about to despair. This is awesome though. Definitely a big help.
Post Reply