PyGeodethy和GeographyClib在Python2.7中可用,但在Python3.6中不可用

2024-09-21 04:46:31 发布

您现在位置:Python中文网/ 问答频道 /正文

我的操作系统是ubuntumate18.04。我想在python3.6中使用python包pygeodesegy和GeographicLib。现在我只能在python2.7中使用这些包。我已经运行了pip install geographiclibpip install PyGeodesy命令。现在我有以下情况:

gus@foo:~$ python -i
Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygeodesy
>>> from geographiclib.geodesic import Geodesic
>>> Geodesic.WGS84.Inverse(-41.32, 174.81, 40.96, -5.50)
{'lat1': -41.32, 'a12': 179.6197069334283, 's12': 19959679.26735382, 'lat2': 40.96, 'azi2': 18.825195123247063, 'azi1': 161.06766998616015, 'lon1': 174.81, 'lon2': -5.5}
>>> {'lat1': -41.32,
...  'a12': 179.6197069334283,
...  's12': 19959679.26735382,
...  'lat2': 40.96,
...  'azi2': 18.825195123248392,
...  'azi1': 161.06766998615882,
...  'lon1': 174.81,
...  'lon2': -5.5}
{'azi2': 18.825195123248392, 'azi1': 161.06766998615882, 'lat1': -41.32, 'lon2': -5.5, 'a12': 179.6197069334283, 'lon1': 174.81, 's12': 19959679.26735382, 'lat2': 40.96}
>>> 
gus@foo:~$ python3 -i
Python 3.6.6 (default, Sep 12 2018, 18:26:19) 
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygeodesy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pygeodesy'
>>> import geographiclib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'geographiclib'
>>> 

更新 我尝试了以下命令,但原始问题仍然存在。在

^{pr2}$

https://packaging.python.org/tutorials/installing-packages/上有一些文档,我认为是相关的,但是我不明白。在


Tags: installpipimport命令modulea12geographicliblat2

热门问题