Hi everyone!
I have tried to install Plotly in Pythonista and I keep getting "cannot import name"-errors.
In a final try I made a fresh install of Phytonista 3 and gave it a new go!
Same procedure on iphone 6SE (12.1.2), ipad mini 4 (12.1.1) and ipad air 2 (12.1.1).
TLDR;
-
Pythonista + StaSh: different folder-structure on 12.1.2 vs 12.1.1.
-
Pythonista + StaSh + Plotly: same folder-structure for 12.1.2 and 12.1.1.
-
Empty local folders (/bin /fsi /man /patches). Is that normal?
-
PIP: I can upgrade on one ipad but the other. --upgrade is an unrecognized argument.
-
Same error on all installations for line 1 in script: import plotly
Everything crashes. 😿
(I have managed to install qhue (https://github.com/quentinsf/qhue)[https://github.com/quentinsf/qhue] with StaSh, and use it, without any problems. )
Installing Stash
- In Console:
import requests as r; exec(r.get('https://bit.ly/get-stash').text)
- Restarted Pythonista
- Ran the file
launch_stash.py
- Restarted Pythonista
- Ran the file
launch_stash.py
again. I get a shell.
The folders on iPhone
Is this how the folder-structure should be built? With a folder for stash_extensions with 4 empty folders? They remain empty, even after I have installed plotly.
SCRIPT LIBRARY
|-- This iPhone
|
|-- [Examples]
|-- [stash_extensions]
|-- [bin] - empty
|-- [fsi] - empty
|-- [man] - empty
|-- [patches] - empty
|-- ICloud
|-- Python Modules
|
|-- Standard Library 2..
|-- Standard Library 3..
|-- [site-packages] (empty)
|-- [site-packages-2] (empty)
|-- [site-packages-3] (empty)
|-- File Templates
|
|-- Readme.md
Installing plotly
1. Ran the pip install plotly
command in the shell. Took half forever.
Got a warning right in the beginning saying "cannot find dependencies".. this is the result:
[...]
Running handler 'console_scripts installer'...
No entry_points.txt found, skipping.
Cleaning up...
Package installed: plotly
[~/Documents]$
[site-packages-3] now have several folders. It seems they are placed in root, there is no folder specific to plotly.
As a plot-twist: The iPads don't get the empty folders inside [This iPad] when installing StaSh. Instead the folders appeared after I installed plotly. They also remain empty.
I get the same error on the ipads as the iPhone when running the same script.
I tried from both iCloud and This iPhone/iPad.
2. I run a script get stuck on line 1.
import plotly.
ImportError
cannot import name 'exceptions'
plotly.py <module> (Line 30)
Print Traceback
Traceback (most recent call last):
File "/private/var/mobile/Library/Mobile Documents/iCloud~com~omz-software~Pythonista3/Documents/Temperature/plotly_entropia.py", line 1, in <module>
import plotly
File "/private/var/mobile/Containers/Shared/AppGroup/63784CB9-E25E-4FFB-A7F4-D38A7B74A24B/Pythonista3/Documents/site-packages-3/plotly/__init__.py", line 10, in <module>
from . plotly import (
File "/private/var/mobile/Containers/Shared/AppGroup/63784CB9-E25E-4FFB-A7F4-D38A7B74A24B/Pythonista3/Documents/site-packages-3/plotly/plotly.py", line 30, in <module>
from plotly import exceptions, files, session, tools, utils
ImportError: cannot import name 'exceptions'
Not working.
Going bananas
1. But I read that an update could help!
plotly.py issue 104
However - as the mess that I am - I did an upgrade of StaSh and not of plotly.
selfupgrade -f
, on iphone, made Pythonista crash.
And as it keeps crashing I will probably have to start over from scratch there...
2 Instead! I move to the ipad air 2!
pip install plotly --upgrade
As stated on https://plot.ly/python/getting-started/, did not work.
pip install --upgrade plotly
>> No download available for upgrade: 0.0.1..
3. The last straw: change an url in /bin/
From topic/4733/stash-install:
The PyPi API was changed. The new link is 'https://pypi.org/pypi/{}/json'. Thus, the simplest way to fix this is to find the pip.py (~/Modules/site-packages/stash/bin/pip.py) and change the old link(http://pypi.python.org/pypi/{}/json) to 'https://pypi.org/pypi/{}/json'
I tried that and restarted the app.
Now also Pythonista on ipad air 2 is crashing...
4. Trying out the upgrade of step 8 on the iPad mini 4
Either way I formatted it:
>> usage: pip.py [-h] [--verbose] [-6] sub-command ...
>> pip.py: error: unrecognized arguments: --upgrade
I need to take a walk now.
Any help would be greatly appreciated! 💟