internet-equity / netrics

The network measurements scheduling framework
7 stars 3 forks source link

Init Error on Python3.9 #37

Closed marcwitasee closed 1 year ago

marcwitasee commented 1 year ago

I tried installing the library on my Mac computer (22.1.0 Darwin Kernel Version 22.1, Ventura 13.0.1). I was able to pip install okay but it failed when I tried to install the configuration file. Python version 3.9.6. See steps below for reproducing.

# create and activate venv
$ python3 -m venv venv
$ source venv/bin/activate

# pip install
$ pip install netrics-measurements

# verify installation
$ which netrics
out: /Users/marcwitasee/test_netrics/venv/bin/netrics

$ netrics init conf
out: [TypeError] expected str, bytes or os.PathLike object, not NoneType
jesteria commented 1 year ago

Thanks for the bug report!

If you're able to re-run the command with a debugging flag that might help a great deal.

In your same environment:

netrics --tb init conf
marcwitasee commented 1 year ago

Sure thing, here is the output I get when I run the command with the --tb flag:

Traceback (most recent call last):
  File "/Users/marcwitasee/test_netrics/venv/bin/netrics", line 8, in <module>
    sys.exit(main())
  File "/Users/marcwitasee/test_netrics/venv/lib/python3.9/site-packages/netrics/__main__.py", line 25, in entrypoint
    hook(
  File "/Users/marcwitasee/test_netrics/venv/lib/python3.9/site-packages/fate/cli/root.py", line 31, in entrypoint
    argcmdr.main(root, extend_parser=partial(extend_parser, **settings))
  File "/Users/marcwitasee/test_netrics/venv/lib/python3.9/site-packages/argcmdr.py", line 76, in main
    command.call()
  File "/Users/marcwitasee/test_netrics/venv/lib/python3.9/site-packages/argcmdr.py", line 377, in call
    return self.delegate('__call__', *additional)
  File "/Users/marcwitasee/test_netrics/venv/lib/python3.9/site-packages/argcmdr.py", line 397, in delegate
    return target_callable(*call_args[:param_count])
  File "/Users/marcwitasee/test_netrics/venv/lib/python3.9/site-packages/fate/cli/base/common.py", line 49, in wrapped
    return method(self, *args, **kwargs)
  File "/Users/marcwitasee/test_netrics/venv/lib/python3.9/site-packages/fate/cli/command/init.py", line 101, in __call__
    prompt = next(executor)
  File "/Users/marcwitasee/test_netrics/venv/lib/python3.9/site-packages/fate/cli/command/init.py", line 224, in execute
    builtins = {path.suffix: path for path in conf._iter_builtins_()}
  File "/Users/marcwitasee/test_netrics/venv/lib/python3.9/site-packages/fate/cli/command/init.py", line 224, in <dictcomp>
    builtins = {path.suffix: path for path in conf._iter_builtins_()}
  File "/Users/marcwitasee/test_netrics/venv/lib/python3.9/site-packages/fate/conf/base/conf.py", line 73, in _iter_builtins_
    builtin_path = self._indicator_builtin_.with_suffix(format_.suffix)
  File "/Users/marcwitasee/test_netrics/venv/lib/python3.9/site-packages/descriptors.py", line 23, in __get__
    setattr(instance, self.__func__.__name__, self.__func__(instance))
  File "/Users/marcwitasee/test_netrics/venv/lib/python3.9/site-packages/fate/util/datastructure/access.py", line 46, in wrapper
    return func(self)
  File "/Users/marcwitasee/test_netrics/venv/lib/python3.9/site-packages/fate/conf/base/conf.py", line 69, in _indicator_builtin_
    return resources.files(self._builtin_.path) / self.__filename__
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/importlib/resources.py", line 147, in files
    return _common.from_package(_get_package(package))
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/importlib/_common.py", line 14, in from_package
    return fallback_resources(package.__spec__)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/importlib/_common.py", line 18, in fallback_resources
    package_directory = pathlib.Path(spec.origin).parent
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/pathlib.py", line 1072, in __new__
    self = cls._from_parts(args, init=False)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/pathlib.py", line 697, in _from_parts
    drv, root, parts = self._parse_args(args)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/pathlib.py", line 681, in _parse_args
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType

@jesteria

jesteria commented 1 year ago

Fix verified by reporter.