Git Product home page Git Product logo

Comments (6)

AndKe avatar AndKe commented on August 14, 2024 1

Thank you for helping.
I tried in 3.9.2 , without venv, then virtual will system packages, then a clean virtual, same issue.
I did also try on 3.7.3 running on the Rpi where it is supposed to be used, and it worked fine there.
So it's only hard to set it up in my pycharm/workstation where I will program.

from suntime.

sewera avatar sewera commented on August 14, 2024

I tried it on Python 3.9.6 with suntime 1.2.5 and didn't have any problems. You didn't provide any environment details, so I don't know if it could be a problem with it, but I can provide some advice, it could be helpful.

It is usually a good practice to use virtual environments, because they can provide better dependency handling, better project reproducibility, and better portability. Fortunately, venv is now standard in Python, so you should be up and running right away.

Here is the full journey, from zero to hero with the example from README.md (don't worry about the pip version warning though):

$ python3 -m venv test_venv
$ cd test_venv
$ source ./bin/activate
$ pip3 install suntime
Collecting suntime
  Using cached suntime-1.2.5-py3-none-any.whl (7.2 kB)
Collecting python-dateutil
  Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting six>=1.5
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: six, python-dateutil, suntime
Successfully installed python-dateutil-2.8.2 six-1.16.0 suntime-1.2.5
WARNING: You are using pip version 21.1.3; however, version 21.2.4 is available.
You should consider upgrading via the '/home/jazz/Data/code_local/scratchbooks/python_scratchbook/test_venv/bin/python3 -m pip install --upgrade pip' command.
$ mkdir src
$ vim src/main.py
$ # copied and pasted the example from README.md from suntime repo
$ python3 src/main.py
Today at Warsaw the sun raised at 03:37 and get down at 17:38 UTC
On 2014-10-03 the sun at Warsaw raised at 06:39 and get down at 18:10.
Error: The sun never rises on this location (on the specified date).
$ python3 --version
Python 3.9.6
$ pip3 --version
pip 21.1.3 from /home/jazz/Data/code_local/scratchbooks/python_scratchbook/test_venv/lib/python3.9/site-packages/pip (python 3.9)

As you can see, all the necessary things for this project to work are in the test_venv directory. Don't forget to source ./bin/activate and deactivate afterwards, but you can always read about it (and more) in the docs.

from suntime.

Litchfield-TWOSE avatar Litchfield-TWOSE commented on August 14, 2024

I'm getting the same issue on Python 3.10. Is there a compatibility issue?

from suntime.

AndKe avatar AndKe commented on August 14, 2024

same on 3.9.7 too.

from suntime.

Andrei-Iosifescu123 avatar Andrei-Iosifescu123 commented on August 14, 2024

If the name of your script is suntime.py, try renaming it to something else. This worked for me on Windows 10 with Python 3.9.5.

from suntime.

AndKe avatar AndKe commented on August 14, 2024

yep, that's most likely what caused this - I remember to have seen something similar long time ago.
Thank you.

from suntime.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.