Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trouble importing #14

Open
ghost opened this issue May 25, 2017 · 6 comments
Open

trouble importing #14

ghost opened this issue May 25, 2017 · 6 comments

Comments

@ghost
Copy link

ghost commented May 25, 2017

Hi, I'm having some trouble importing pytides, running Python 3.6.0 on 64 bit Anaconda.
Anyone else run into this?

>>> import pytides
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\ProgramData\Anaconda3\lib\site-packages\pytides\__init__.py", line 1,
 in <module>
    import tide
ModuleNotFoundError: No module named 'tide'

@vic1309
Copy link

vic1309 commented Jul 12, 2017

I'm facing this issue too, vchkan. Did you solve it?

@ghost
Copy link
Author

ghost commented Jul 13, 2017

Hi vic, got it working with Anaconda Python 2.7.

@jonnekleijer
Copy link

jonnekleijer commented Aug 14, 2017

Hi Vic,
Looks like the code is made for Python 2.(7).

  • The relative import does not work in python 3.6 (e.g. "import nodal_corrections" as nc should be "from pytides import nodal_corrections as nc" in constituent.py).
  • Also "reduce" is not used in Python 3, and should then be replaced by functools.reduce(), however for loop is more readible.

@vic1309
Copy link

vic1309 commented Aug 14, 2017 via email

@drf5n
Copy link
Contributor

drf5n commented Apr 26, 2018

@drf5n
Copy link
Contributor

drf5n commented Sep 6, 2023

I get this error

% ipython
Python 3.11.4 (main, Jul  5 2023, 08:41:25) [Clang 14.0.6 ]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.12.2 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import pytides
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[1], line 1
----> 1 import pytides

File ~/anaconda3/envs/junkbuild/lib/python3.11/site-packages/pytides/__init__.py:3
      1 # -*- coding: utf-8 -*-
----> 3 import tide
      4 import astro
      5 import constituent

File ~/Work/pytides/pytides/tide.py:14
     12 from scipy.optimize import leastsq, fsolve
     13 from scipy.linalg import norm
---> 14 from .astro import astro
     15 from . import constituent
     17 def unique(iterable):

ImportError: attempted relative import with no known parent package


I installed a different fork of pytides and it worked:

pip install git+https://github.com/drf5n/pytides.git
% ipython                                             
Python 3.11.4 (main, Jul  5 2023, 08:41:25) [Clang 14.0.6 ]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.12.2 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import pytides

In [2]: dir(pytides.tide)
Out[2]: 
['Iterable',
 'OrderedDict',
 'Tide',
 '__builtins__',
 '__cached__',
 '__doc__',
 '__file__',
 '__loader__',
 '__name__',
 '__package__',
 '__spec__',
 'astro',
 'constituent',
 'count',
 'datetime',
 'filterfalse',
 'fsolve',
 'ifilter',
 'izip',
 'leastsq',
 'norm',
 'np',
 'takewhile',
 'timedelta',
 'unique']

In [3]: 

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

No branches or pull requests

3 participants