This repository has been archived by the owner on Oct 14, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 276
OrbitPlotter2D & 3D not working #1624
Comments
Hi @beluej123! If you installed poliastro using: pip install https://github.com/poliastro/poliastro/archive/main.zip it means you installed the development version in which the I strongly suggest you to install poliastro in a clean environment and use the latest stable version for users by doing: python -m venv .venv
.venv\Scripts\Activate.ps1
python -m pip install poliastro |
Jorge Martinez,Thank you for your help.OrbitPlotter3D now plotting (with a deprecation warning). I've run a of couple tests to make sure I get the plots. I assume OrbitPlotter2D also works.When I installed the development version, I thought I was doing the smart "thing".
1) I followed your suggestion to install poliastro in a clean environment - I deleted all the poliastro install files.Then re-generated the virtual environment/activated/installed as you noted below: python -m venv .venv
.venv\Scripts\Activate.ps1
python -m pip install poliastro
2) For me the 3D figure still plots, however, as a reminder...When I copy and execute the python/Jupyter code from the poliastro Gallary noted in the link below;https://docs.poliastro.space/en/stable/examples/Going%20to%20Mars%20with%20Python%20using%20poliastro.html
I get (a) the deprecation warning, and (b) an install missing notice, noted within the quotes below:"C:\Users\belue\AppData\Local\Temp\ipykernel_3636\3089014888.py:9: DeprecationWarning:
Specifying min_anomaly and max_anomaly in method `sample` is deprecated and will be removed in a future release, use `Orbit.to_ephem(strategy=TrueAnomalyBounds(min_nu=..., max_nu=...))` instead
…---------------------------------------------------------------------------ValueError Traceback (most recent call last)File c:\Users\belue\Documents\Data\OrbMech\02-Poliastro\.venv\lib\site-packages\IPython\core\formatters.py:922, in IPythonDisplayFormatter.__call__(self, obj) 920 method = get_real_method(obj, self.print_method) 921 if method is not None:--> 922 method() 923 return TrueFile c:\Users\belue\Documents\Data\OrbMech\02-Poliastro\.venv\lib\site-packages\plotly\basedatatypes.py:834, in BaseFigure._ipython_display_(self) 831 import plotly.io as pio 833 if pio.renderers.render_on_display and pio.renderers.default:--> 834 pio.show(self) 835 else: 836 print(repr(self))File c:\Users\belue\Documents\Data\OrbMech\02-Poliastro\.venv\lib\site-packages\plotly\io\_renderers.py:396, in show(fig, renderer, validate, **kwargs) 391 raise ValueError( 392 "Mime type rendering requires ipython but it is not installed" 393 ) 395 if not nbformat or Version(nbformat.__version__) < Version("4.2.0"):--> 396 raise ValueError( 397 "Mime type rendering requires nbformat>=4.2.0 but it is not installed" 398 ) 400 ipython_display.display(bundle, raw=True) 402 # external renderersValueError: Mime type rendering requires nbformat>=4.2.0 but it is not installed"
On Saturday, April 22, 2023 at 04:29:22 PM CDT, Jorge Martínez ***@***.***> wrote:
Hi @beluej123! If you installed poliastro using:
pip install https://github.com/poliastro/poliastro/archive/main.zip
it means you installed the development version in which the OrbitPlotter3D class is no longer available.
I strongly suggest you to install poliastro in a clean environment and use the latest stable version for users by doing:
python -m venv .venv
.venv\Scripts\Activate.ps1
python -m pip install poliastro
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The command below generates import error: cannot import name 'OrbitPlotter3D'
from poliastro.plotting import OrbitPlotter3D
🐞 Problem
I am replicating some poliastro examples in the Gallery but ran into plot issues.
The following links are where I copied the python files:
https://docs.poliastro.space/en/stable/gallery.html
https://docs.poliastro.space/en/stable/examples/Going%20to%20Mars%20with%20Python%20using%20poliastro.html
Note, the following command,
from poliastro.plotting import OrbitPlotter3D
Gives me the following error:
ImportError Traceback (most recent call last)
Cell In[1], line 1
----> 1 from poliastro.plotting import OrbitPlotter3D
ImportError: cannot import name 'OrbitPlotter3D' from 'poliastro.plotting'
(c:\ ... \02-Poliastro.venv\lib\site-packages\poliastro\plotting_init_.py)
For poliastroI am running python 3.10.10 under VSCode.
🖥
I do not use conda.
I installed poliastro with the command from the poliastro installation page: https://docs.poliastro.space/en/stable/installation.html
pip install https://github.com/poliastro/poliastro/archive/main.zip
My directory structure uses the python virtual environment (.venv), under VSCode ...
c:\ ... 02-Poliastro
--.venv
-------ect
-------Include
-------Lib
-------Scripts
-------Share
--poliastro
-------all the subdirectories from the install
💡 Possible solutions
Maybe I am missing a dependency?
Seems to me there is a missing code definition for OrbitPlotter2D and OrbitPlotter3D?
Note, "pip freeze" from my 02-Poliastro directory gives the following:
anyio==3.6.2
argon2-cffi==21.3.0
argon2-cffi-bindings==21.2.0
arrow==1.2.3
asttokens==2.2.1
attrs==22.2.0
backcall==0.2.0
beautifulsoup4==4.12.0
bleach==6.0.0
certifi==2022.12.7
cffi==1.15.1
colorama==0.4.6
comm==0.1.3
cycler==0.11.0
debugpy==1.6.6
decorator==5.1.1
defusedxml==0.7.1
distlib==0.3.6
executing==1.2.0
fastjsonschema==2.16.3
filelock==3.10.2
fonttools==4.39.0
fqdn==1.5.1
idna==3.4
ipykernel==6.22.0
ipython==8.11.0
ipython-genutils==0.2.0
ipywidgets==8.0.5
isoduration==20.11.0
jedi==0.18.2
Jinja2==3.1.2
jsonpointer==2.3
jsonschema==4.17.3
jupyter==1.0.0
jupyter-console==6.6.3
jupyter-events==0.6.3
jupyter_client==8.1.0
jupyter_core==5.3.0
jupyter_server==2.5.0
jupyter_server_terminals==0.4.4
jupyterlab-pygments==0.2.2
jupyterlab-widgets==3.0.6
kiwisolver==1.4.4
MarkupSafe==2.1.2
matplotlib-inline==0.1.6
mistune==2.0.5
nbclassic==0.5.3
nbclient==0.7.2
nbconvert==7.2.10
nbformat==5.8.0
nest-asyncio==1.5.6
notebook==6.5.3
notebook_shim==0.2.2
numpy==1.24.2
packaging==23.0
pandocfilters==1.5.0
parso==0.8.3
pickleshare==0.7.5
Pillow==9.4.0
platformdirs==3.1.1
plotly==5.13.1
prometheus-client==0.16.0
prompt-toolkit==3.0.38
psutil==5.9.4
pure-eval==0.2.2
pycparser==2.21
pyerfa==2.0.0.1
Pygments==2.14.0
pyparsing==3.0.9
pyrsistent==0.19.3
python-dateutil==2.8.2
python-json-logger==2.0.7
pytz==2022.7.1
pywin32==305
pywinpty==2.0.10
PyYAML==6.0
pyzmq==25.0.2
qtconsole==5.4.1
QtPy==2.3.0
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
Send2Trash==1.8.0
six==1.16.0
sniffio==1.3.0
soupsieve==2.4
stack-data==0.6.2
tenacity==8.2.2
terminado==0.17.1
tinycss2==1.2.1
tornado==6.2
traitlets==5.9.0
uri-template==1.2.0
wcwidth==0.2.6
webcolors==1.12
webencodings==0.5.1
websocket-client==1.5.1
widgetsnbextension==4.0.6
📋 Steps to solve the problem
I do not know how to solve this problem, so I look forward to your suggestions.
Thank you for your help.
The text was updated successfully, but these errors were encountered: