iRB-Lab / py-ga-VRPTW

A Python Implementation of a Genetic Algorithm-based Solution to Vehicle Routing Problem with Time Windows
MIT License
560 stars 170 forks source link

Error in __init__.py #17

Closed AyeshaMaroof-ai closed 2 years ago

AyeshaMaroof-ai commented 2 years ago

Hello I am trying to run this code in Jupyternote book. When I run the command given in __init__.py

import os

BASE_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))

it gives me this error:


NameError                                 Traceback (most recent call last)
<ipython-input-1-640754eed479> in <module>
      2 
      3 
----> 4 BASE_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))

NameError: name '__file__' is not defined

Can you tell me what possible error I am making here?

iROCKBUNNY commented 2 years ago

Using a virtual environment is strongly recommended, which is detailed in the README.md.