Skip to content
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.

OrbitPlotter2D & 3D not working #1624

Open
beluej123 opened this issue Apr 21, 2023 · 2 comments
Open

OrbitPlotter2D & 3D not working #1624

beluej123 opened this issue Apr 21, 2023 · 2 comments

Comments

@beluej123
Copy link

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.

@jorgepiloto
Copy link
Member

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

@beluej123
Copy link
Author

beluej123 commented Apr 23, 2023 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants