Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Installing Pygal
-
I'm trying to install pygal. To do this, I pasted pipista into an empty script and saved it in site-packages. I created another empty script in site-packages with the following code, but receive an ImportError that there is "no module named pipista":
import pipista pipista.pypi_install('pygal')
Pipista appears to be written for Python 2.7, so I set this as my default interpreter, but I'm still having issues. What am I doing wrong? Will my second line of code even install Pygal? Is there anything else I'll need to do?
I'm very new to this so any help is greatly appreciated. Thanks!
-
For me no Import error but I put the little script for importing, in the root, not in the site-packages folder.
Even if I put this script in the same site-packages folder, I don't have any import error.
Sure of the name pipista.py? -
Your mistake might be using pipists, which was last updated 4 years ago, and is not supported anymore :)
Try stash, pip command, which is mostly bulletproof.
https://github.com/ywangd/stashOut of curiosity, where did you stumble upon pipista?
-
Thanks to both of you. I'll try stash. I read about pipista on other threads, like this one: https://forum.omz-software.com/topic/708/using-pipista
-
Thanks again @JonB -- stash worked great for installing Pygal, but now when I go to import pygal, I receive this error:
No module named 'pkg_resources'
Any ideas how to fix this?
-
ugh, pkg_resources is a pain...
This:
https://forum.omz-software.com/topic/1933/stash-pip-and-pylintmay be of some help. This might require manually downloading using stash wget, then copying the egg info files into site packages. Also you will need to install setuptools and pkg_resources.
@dgelessus had a "fistutils" which i think allowed setuptools to work on pythonista, but I am not entirely sure.
-
fistutils was very "experimental" to say the least. It's a hack that only barely works and isn't very useful in the end, there isn't much that fistutils pip can do that stash pip can't.
As for
pkg_resources
, you could try getting the standardpkg_resources
package from https://github.com/pypa/setuptools. I don't have a custom version or patch ofpkg_resources
in fistutils, which means that the standard version might work unmodified on Pythonista. -
I tried to download setuptools and copy its
pkg_resources
sub-folder intosite-packages
. Thenimport pygal
just worked. Maybe we can make this a standard process to installpkg_resources
the first time stashpip
is called.By the way, these are the commands I used to install
pkg_resources
.pip download setuptools tar -zxvf setuptools-25.1.0.tar.gz cp setuptools-25.1.0/pkg_resources site-packages/
If there are any import errors afterwards, try restart Pythonista.
-
Wow, that worked, @ywangd ! Thank you!