Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    How to Install pytz/dateutil python modules

    Development
    3
    5
    2.9k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      guardian Rebel Alliance
      last edited by

      Sorry I'm a bit lost with FreeBSD, I can do this with Windows or Linux, but I need a bit of help with FreeBSD/pfSense.

      I'm doing some custom scripting, and I need to be able to convert from local time (both my local time, and anther server that is in another time zone)to gmt.  Unfortunately datetime.strptime "%z" doesn't work, so it looks like I need to resort to either pytz or dateutil module which isn't part of the standard library.

      Is there an easy way to install modules?  Should I install pip?  (Is this easy to do?/How?)

      Best way to deal with system updates if I do?

      I would like to make the least change possible to the system.

      Thanks.

      If you find my post useful, please give it a thumbs up!
      pfSense 2.7.2-RELEASE

      1 Reply Last reply Reply Quote 0
      • RonpfSR
        RonpfS
        last edited by

        python2.7 -m ensurepip

        2.4.5-RELEASE-p1 (amd64)
        Intel Core2 Quad CPU Q8400 @ 2.66GHz 8GB
        Backup 0.5_5, Bandwidthd 0.7.4_4, Cron 0.3.7_5, pfBlockerNG-devel 3.0.0_16, Status_Traffic_Totals 2.3.1_1, System_Patches 1.2_5

        1 Reply Last reply Reply Quote 0
        • G
          guardian Rebel Alliance
          last edited by

          @RonpfS:

          python2.7 -m ensurepip

          Thanks…

          For the benefit of the other noobs:

          python2.7 -m ensurepip

          • installs pip

          python2.7 -m pip install pytz

          • installs module pytz

          Follow up questions:

          When I ran the install I got the following mesages:
          Successfully installed pytz-2016.6.1
          You are using pip version 8.1.1, however version 8.1.2 is available.
          You should consider upgrading via the 'pip install –upgrade pip' command.

          Should I upgrade pip as suggested, or is this likely to cause trouble?

          Will these changes survive an upgrade, or do they need to be reapplied?

          Thanks.

          If you find my post useful, please give it a thumbs up!
          pfSense 2.7.2-RELEASE

          1 Reply Last reply Reply Quote 0
          • RonpfSR
            RonpfS
            last edited by

            I just updated  ::)

            2.4.5-RELEASE-p1 (amd64)
            Intel Core2 Quad CPU Q8400 @ 2.66GHz 8GB
            Backup 0.5_5, Bandwidthd 0.7.4_4, Cron 0.3.7_5, pfBlockerNG-devel 3.0.0_16, Status_Traffic_Totals 2.3.1_1, System_Patches 1.2_5

            1 Reply Last reply Reply Quote 0
            • O
              opoplawski
              last edited by

              pkg install py27-dateutil
              or
              pkg install py27-pytz

              This won't work for all python modules, but there are a number of pre-packaged ones including these.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.