Error 13 when trying to install my plugin with dev plugin:install


#1

Trying to develop my first plugin and I have been folloing the offical "tutorial" on the docs.octorpint.org site. I'm developing on a Windows 10 installation.

I'm now at the stage where I'm ready to install the cookiecutter created plugin with the help of the command

octoprint dev plugin:install

This is where I run into problems, it seems like octoprint is trying to reinstall it-self and returns a Error 5 code when it tries to change octoprint.exe (which is already running). I found this old thread where it says that this problems should be fixed by 1.3.3. I'm using 1.3.9 so I'm guessing it should be fixed.

Is there some known work around I've failed to find to solve this problem?

Here is my log.

D:\Projekt\OctoPrintPlugin\OctoPrint\venv\Scripts\python.exe -m pip install -e .
Obtaining file:///D:/Projekt/OctoPrintPlugin/OctoPrint

Requirement already satisfied: flask<0.11,>=0.10.1 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (0.10.1)

Requirement already satisfied: Jinja2<2.9,>=2.8.1 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (2.8.1)

Requirement already satisfied: werkzeug<0.9,>=0.8.3 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (0.8.3)

Requirement already satisfied: tornado==4.5.3 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (4.5.3)

Requirement already satisfied: PyYAML<3.11,>=3.10 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (3.10)

Requirement already satisfied: Flask-Login<0.3,>=0.2.11 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (0.2.11)

Requirement already satisfied: Flask-Principal<0.4,>=0.3.5 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (0.3.5)

Requirement already satisfied: Flask-Babel<0.10,>=0.9 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (0.9)

Requirement already satisfied: Flask-Assets<0.11,>=0.10 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (0.10)

Requirement already satisfied: markdown<2.7,>=2.6.9 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (2.6.11)

Requirement already satisfied: pyserial<3.5,>=3.4 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (3.4)

Requirement already satisfied: netaddr<0.8,>=0.7.19 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (0.7.19)

Requirement already satisfied: watchdog<0.9,>=0.8.3 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (0.8.3)

Requirement already satisfied: sarge==0.1.4 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (0.1.4)

Requirement already satisfied: netifaces<0.11,>=0.10.6 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (0.10.7)

Requirement already satisfied: pylru<1.1,>=1.0.9 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (1.0.9)

Requirement already satisfied: rsa<3.3,>=3.2.3 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (3.2.3)

Requirement already satisfied: pkginfo<1.5,>=1.4.2 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (1.4.2)

Requirement already satisfied: requests<3,>=2.18.4 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (2.19.1)

Requirement already satisfied: semantic_version<2.5,>=2.4.2 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (2.4.2)

Requirement already satisfied: psutil<5.5,>=5.4.6 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (5.4.7)

Requirement already satisfied: Click<6.3,>=6.2 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (6.2)

Requirement already satisfied: awesome-slugify<1.7,>=1.6.5 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (1.6.5)

Requirement already satisfied: feedparser<5.3,>=5.2.1 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (5.2.1)

Requirement already satisfied: chainmap<1.1,>=1.0.2 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (1.0.2)

Requirement already satisfied: future<0.16,>=0.15.2 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (0.15.2)

Requirement already satisfied: scandir<1.4,>=1.3 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (1.3)

Requirement already satisfied: websocket-client<0.41,>=0.40.0 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (0.40.0)

Requirement already satisfied: python-dateutil<2.7,>=2.6.1 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (2.6.1)

Requirement already satisfied: wrapt<1.11,>=1.10.11 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (1.10.11)

Requirement already satisfied: futures<3.2,>=3.1.1 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (3.1.1)

Requirement already satisfied: emoji<0.5,>=0.4.5 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (0.4.5)

Requirement already satisfied: monotonic<1.4,>=1.3 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (1.3)

Requirement already satisfied: frozendict<1.3,>=1.2 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (1.2)

Requirement already satisfied: itsdangerous>=0.21 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from flask<0.11,>=0.10.1->OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (0.24)

Requirement already satisfied: MarkupSafe in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from Jinja2<2.9,>=2.8.1->OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (1.0)

Requirement already satisfied: singledispatch in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from tornado==4.5.3->OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (3.4.0.3)

Requirement already satisfied: certifi in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from tornado==4.5.3->OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (2018.8.24)

Requirement already satisfied: backports-abc>=0.4 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from tornado==4.5.3->OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (0.5)

Requirement already satisfied: blinker in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from Flask-Principal<0.4,>=0.3.5->OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (1.4)

Requirement already satisfied: Babel>=1.0 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from Flask-Babel<0.10,>=0.9->OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (2.6.0)

Requirement already satisfied: speaklater>=1.2 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from Flask-Babel<0.10,>=0.9->OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (1.3)

Requirement already satisfied: webassets>=0.10 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from Flask-Assets<0.11,>=0.10->OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (0.12.1)

Requirement already satisfied: argh>=0.24.1 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from watchdog<0.9,>=0.8.3->OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (0.26.2)

Requirement already satisfied: pathtools>=0.1.1 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from watchdog<0.9,>=0.8.3->OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (0.1.2)

Requirement already satisfied: pyasn1>=0.1.3 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from rsa<3.3,>=3.2.3->OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (0.4.4)

Requirement already satisfied: idna<2.8,>=2.5 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from requests<3,>=2.18.4->OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (2.7)

Requirement already satisfied: urllib3<1.24,>=1.21.1 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from requests<3,>=2.18.4->OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (1.23)

Requirement already satisfied: chardet<3.1.0,>=3.0.2 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from requests<3,>=2.18.4->OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (3.0.4)

Requirement already satisfied: Unidecode<0.05,>=0.04.14 in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from awesome-slugify<1.7,>=1.6.5->OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (0.4.21)

Requirement already satisfied: regex in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from awesome-slugify<1.7,>=1.6.5->OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (2018.8.29)

Requirement already satisfied: six in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from websocket-client<0.41,>=0.40.0->OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (1.11.0)

Requirement already satisfied: pytz>=0a in d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages (from Babel>=1.0->Flask-Babel<0.10,>=0.9->OctoPrint==1.3.9.post1.dev0+ge5eb72cb) (2018.5)

Installing collected packages: OctoPrint

  Found existing installation: octoprint 1.3.9

    Uninstalling octoprint-1.3.9:

      Successfully uninstalled octoprint-1.3.9

  Running setup.py develop for OctoPrint

    Complete output from command D:\Projekt\OctoPrintPlugin\OctoPrint\venv\Scripts\python.exe -c "import setuptools, tokenize;__file__='D:\\Projekt\\OctoPrintPlugin\\OctoPrint\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n',
'\n');f.close();exec(compile(code, __file__, 'exec'))" develop --no-deps:

    running develop

    running egg_info

    writing requirements to src\OctoPrint.egg-info\requires.txt

    writing src\OctoPrint.egg-info\PKG-INFO

    writing top-level names to src\OctoPrint.egg-info\top_level.txt

    writing dependency_links to src\OctoPrint.egg-info\dependency_links.txt

    writing entry points to src\OctoPrint.egg-info\entry_points.txt

    reading manifest file 'src\OctoPrint.egg-info\SOURCES.txt'

    reading manifest template 'MANIFEST.in'

    writing manifest file 'src\OctoPrint.egg-info\SOURCES.txt'

    running build_ext

    Creating d:\projekt\octoprintplugin\octoprint\venv\lib\site-packages\OctoPrint.egg-link (link to src)

    OctoPrint 1.3.9.post1.dev0+ge5eb72cb is already the active version in easy-install.pth

    Installing octoprint-script.py script to D:\Projekt\OctoPrintPlugin\OctoPrint\venv\Scripts

    Installing octoprint.exe script to D:\Projekt\OctoPrintPlugin\OctoPrint\venv\Scripts

    error: [Error 5] Åtkomst nekad: 'D:\\Projekt\\OctoPrintPlugin\\OctoPrint\\venv\\Scripts\\octoprint.exe'



    ----------------------------------------

  Rolling back uninstall of octoprint

Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: 'd:\\projekt\\octoprintplugin\\octoprint\\venv\\scripts\\octoprint.exe'

Consider using the `--user` option or check the permissions.

#2

Did you activate the virtual environment you created at:

d:\projekt\octoprintplugin\octoprint\venv

Usually I'd expect console output to be prefixed with (venv). Look at this output from activating the virtual environment:

C:\source\repos\Octolapse_V1_0\OctoPrint>.\venv\scripts\activate.bat

(venv) C:\source\repos\Octolapse_V1_0\OctoPrint>

Is this the tutorial you are following?

Also, did you follow this guide for configuring pycharm? It REALLY is nice that it can auto-install your plugin with every build!

Let me know how it goes.


#3

Yeah I'm working within the v-env, I just copied the text and not actually the log so that's probably why it didn't show. In the cmd it does say venv before so that's working.

I did set up my pycharm following the guide but it's possible I did something wrong there, need to dubbelcheck it again.

The tutorial I'm following is this one. Had no problems until I tried to use the

octoprint dev plugin:install

I can start the server with serve no problem and my "plugin" shows up when I use the form created in this tutorial. It just does not work when I try to install it with octoprint :expressionless:


#4

I'm really confused that it's attempting to reinstall OctoPrint there :face_with_raised_eyebrow: I just tried it myself and it didn't do that here.

The error you are getting is due to that though - Windows locks down the octoprint.exe executable when the process is running, hence you get a permission denied error when pip attempts to replace it during the update that for some reason gets triggered here. That's also the reason why auto updating doesn't work in general under Windows.

octoprint dev plugin:install is basically just a wrapper around pip install -e ., it just makes sure the right pip is used (the one that your OctoPrint instance is installed under). You could just as well run pip install -e . and it should work just fine as long as the virtual environment that you installed OctoPrint in is activated.


#5

@foosel,

this is what I'm using to update dependencies within pycharm:

pip install -e .[develop,plugins]

Can you explain what the difference is between that and this

pip install -e .

The pip documentation isn't particularly helpful here. I can't even figure out what the -e parameter is supposed to do.

Thanks!


#6

@FormerLurker

the -e turns it into an editable install - basically it doesn't copy all the files but instead just sets a link, meaning that if you now modify the sources and restart (or in the case of frontend stuff just refresh) you immediately have the changes active without having to reinstall. Can speed things up a ton during development, not recommended for productive environments though simply to reduce the risk of accidental modifications :wink:

The [develop,plugins] stuff is only relevant for OctoPrint itself and tells pip to not only install the default dependencies, but also those attached to the develop and plugins sub components.


#7

Running pip install -e .[develop,plugins] does not return an error (progress?) but does not install my plugin either which leads me to believe that there's something going on with my plugin that needs fixing.

Currently running the Hello World example plugin from the cookiecutter guide just to eliminate any variables. At least I'm on the right track, thanks for taking the time to answer me :slight_smile: