Python Forum
Can't install nor import delorean module
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can't install nor import delorean module
#1
Good Friday evening to you all Pythoners. I believe this is my first post here in your forums and hope this is the correct place for it.
I'm using Jupyter notebook in VSCode and am trying to import the delorean module.
I've added it to a requirements.txt file ->

Quote:delorean==1.0.0
requests==2.22.0

and install it from the terminal thus ->
pip install -r requirements.txt

It starts to build everything fine and then I get the following error message:

Quote:ERROR: Command errored out with exit status 1:
command: /home/technodiver/CustomScripts/python/webscraping/pythonAutomation/chapt1/.venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-cuxxdi7p/delorean/setup.py'"'"'; __file__='"'"'/tmp/pip-install-cuxxdi7p/delorean/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-siiztfye
cwd: /tmp/pip-install-cuxxdi7p/delorean/
Complete output (6 lines):
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help

error: invalid command 'bdist_wheel'
----------------------------------------
ERROR: Failed building wheel for delorean

BUT, after that it says that delorean was installed :

Quote: Running setup.py clean for delorean
Failed to build delorean
Installing collected packages: pytz, babel, humanize, six, python-dateutil, backports.zoneinfo, tzdata, pytz-deprecation-shim, tzlocal, delorean, chardet, idna, urllib3, certifi, requests
Running setup.py install for delorean ... done
Successfully installed babel-2.9.1 backports.zoneinfo-0.2.1 certifi-2021.10.8 chardet-3.0.4 delorean-1.0.0 humanize-3.12.0 idna-2.8 python-dateutil-2.8.2 pytz-2021.3 pytz-deprecation-shim-0.1.0.post0 requests-2.22.0 six-1.16.0 tzdata-2021.4 tzlocal-4.0.1 urllib3-1.25.11

When I try to import it I get the ModuleNotFoundError that I'm sure you're all familiar with and won't repeat it.

Can someone give me a clue to what's happening and more importantly - how to fix it?? Thank you

PS When I had delorean installed in another directory, in a different venv it installed without issue, and I still got the module not found error when I tried to import it. checking the install it told me all requirements were already satisfied but it wouldn't import. That's when I deactivated and deleted that venv, made it in another directory and now get that long error message.
Reply
#2
try (from command line): pip install delorean
then to see if it's properly installed: pip list
you can then update your requirements.txt with: pip freeze > requirements.txt
Tek likes this post
Reply
#3
It try to build wheel then it will use setup.py and should work with that to.
So can first try pip install wheel,but should not get that error message doing that,so something else is wrong.

Here a quick run and name your virtual environment so no conflict occurs.
# Make
[email protected]:~$ python -m venv del_env
[email protected]:~$ cd del_env/
# Activate 
[email protected]:~/del_env$ source bin/activate

# Make requirements.txt
(del_env) [email protected]:~/del_env$ vi requirements.txt
(del_env) [email protected]:~/del_env$ cat requirements.txt 
delorean==1.0.0
requests==2.22.0
(del_env) [email protected]:~/del_env$ ls
bin  include  lib  lib64  pyvenv.cfg  requirements.txt

# Install
(del_env) [email protected]:~/del_env$ pip install -r requirements.txt 
Collecting delorean==1.0.0
  Downloading Delorean-1.0.0.tar.gz (18 kB)
.....
Using legacy 'setup.py install' for delorean, since package 'wheel' is not installed.
Installing collected packages: tzdata, six, pytz-deprecation-shim, pytz, urllib3, tzlocal, python-dateutil, idna, humanize, chardet, certifi, babel, requests, delorean
    Running setup.py install for delorean ... done
Successfully installed babel-2.9.1 certifi-2021.10.8 chardet-3.0.4 delorean-1.0.0 humanize-3.12.0 idna-2.8 python-dateutil-2.8.2 pytz-2021.3 pytz-deprecation-shim-0.1.0.post0 requests-2.22.0 six-1.16.0 tzdata-2021.4 tzlocal-4.0.1 urllib3-1.25.11 

# Test that it work
[python]Python 3.9.6 (default, Aug  3 2021, 16:49:17) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from delorean import Delorean
>>>
>>> d = Delorean()
>>> d
Delorean(datetime=datetime.datetime(2021, 10, 23, 9, 17, 26, 848343), timezone='UTC')
See that this message comes legacy 'setup.py install' for delorean, since package 'wheel' is not installed.,
so even without wheel installed it should work as it use setup.py install.

Pendulum is better choice as delorean don't get updated enough.
Reply
#4
(Oct-23-2021, 10:02 AM)snippsat Wrote: Pendulum is better choice as delorean don't get updated enough.

Thanks for your replies I believe I have it working now. I'm going to continue using Delorean as it's being used in the tutorial I'm working through at the moment. I'll be looking into Pendulum when I'm move familiar with things. I appreciate your help
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Import a module for use in type hint? Milosz 0 136 Nov-08-2021, 06:49 PM
Last Post: Milosz
  import module with syntax error Skaperen 7 959 Jun-22-2021, 10:38 AM
Last Post: Skaperen
  'urllib3' Module not found when import 'requests' spanz 5 3,436 Jan-06-2021, 05:57 PM
Last Post: snippsat
  Unable to install module rrowhe4d 1 1,031 Oct-13-2020, 10:20 AM
Last Post: Larz60+
  Problem with Flask Bcrypt import module marcello86 2 1,676 Aug-31-2020, 08:10 PM
Last Post: marcello86
  trying to pip install stasm module getting error djf123 3 2,078 Jul-26-2020, 05:00 AM
Last Post: millpond
  Install thresding module kalvarix 2 908 May-04-2020, 03:25 PM
Last Post: kalvarix
  Unable to import my own module ThePhantom 3 1,175 May-01-2020, 01:30 AM
Last Post: menator01
  Install module with pip3 on a non root user matthewpintor2107 1 1,054 Apr-28-2020, 03:16 PM
Last Post: pyzyx3qwerty
  Error while humansize module import. johnkgson 3 1,707 Apr-26-2020, 08:37 AM
Last Post: johnkgson

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020