Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cython3 need mentioning in the dependencies #91

Open
hzeller opened this issue Sep 1, 2022 · 1 comment
Open

cython3 need mentioning in the dependencies #91

hzeller opened this issue Sep 1, 2022 · 1 comment

Comments

@hzeller
Copy link

hzeller commented Sep 1, 2022

When running the compile as in the README, the following failure happens:

$ python3 setup.py test
Traceback (most recent call last):
  File "/home/hzeller/src/fasm/setup.py", line 28, in <module>
    from Cython.Build import cythonize
ModuleNotFoundError: No module named 'Cython'

So in the apt install line, it would then require cython3

Then, the setup test runs but it still fails with some other issue, please advise:

  File "/home/hzeller/src/fasm/setup.py", line 265, in <module>
    setuptools.setup(
  File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.10/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.10/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/setuptools/command/test.py", line 223, in run
    self.run_tests()
  File "/usr/lib/python3/dist-packages/setuptools/command/test.py", line 226, in run_tests
    test = unittest.main(
  File "/usr/lib/python3.10/unittest/main.py", line 100, in __init__
    self.parseArgs(argv)
  File "/usr/lib/python3.10/unittest/main.py", line 124, in parseArgs
    self._do_discovery(argv[2:])
  File "/usr/lib/python3.10/unittest/main.py", line 244, in _do_discovery
    self.createTests(from_discovery=True, Loader=Loader)
  File "/usr/lib/python3.10/unittest/main.py", line 154, in createTests
    self.test = loader.discover(self.start, self.pattern, self.top)
  File "/usr/lib/python3.10/unittest/loader.py", line 349, in discover
    tests = list(self._find_tests(start_dir, pattern))
  File "/usr/lib/python3.10/unittest/loader.py", line 405, in _find_tests
    tests, should_recurse = self._find_test_path(
  File "/usr/lib/python3.10/unittest/loader.py", line 483, in _find_test_path
    tests = self.loadTestsFromModule(package, pattern=pattern)
  File "/usr/lib/python3/dist-packages/setuptools/command/test.py", line 42, in loadTestsFromModule
    tests.append(TestLoader.loadTestsFromModule(self, module))
  File "/usr/lib/python3.10/unittest/loader.py", line 121, in loadTestsFromModule
    for name in dir(module):
TypeError: 'str' object is not callable

Since the stacktrace is a bit hard to read as Python reverses it, here a bit more digestable:

TypeError: 'str' object is not callable
        /usr/lib/python3.10/unittest/loader.py:121           loadTestsFromModule    for name in dir(module):
        /usr/lib/python3/dist-packages/setuptools/command/test.py:42 loadTestsFromModule    tests.append(TestLoader.loadTestsFromModule(self, module))
        /usr/lib/python3.10/unittest/loader.py:483           _find_test_path    tests = self.loadTestsFromModule(package, pattern=pattern)
        /usr/lib/python3.10/unittest/loader.py:405           _find_tests        tests, should_recurse = self._find_test_path(
        /usr/lib/python3.10/unittest/loader.py:349           discover           tests = list(self._find_tests(start_dir, pattern))
        /usr/lib/python3.10/unittest/main.py:154             createTests        self.test = loader.discover(self.start, self.pattern, self.top)
        /usr/lib/python3.10/unittest/main.py:244             _do_discovery      self.createTests(from_discovery=True, Loader=Loader)
        /usr/lib/python3.10/unittest/main.py:124             parseArgs          self._do_discovery(argv[2:])
        /usr/lib/python3.10/unittest/main.py:100             __init__           self.parseArgs(argv)
        /usr/lib/python3/dist-packages/setuptools/command/test.py:226 run_tests          test = unittest.main(
        /usr/lib/python3/dist-packages/setuptools/command/test.py:223 run                self.run_tests()
        /usr/lib/python3.10/distutils/dist.py:985            run_command        cmd_obj.run()
        /usr/lib/python3.10/distutils/dist.py:966            run_commands       self.run_command(cmd)
        /usr/lib/python3.10/distutils/core.py:148            setup              dist.run_commands()
        /usr/lib/python3/dist-packages/setuptools/__init__.py:153 setup              return distutils.core.setup(**attrs)
        /home/hzeller/src/fasm/setup.py:265                  <module>           setuptools.setup(

I have no idea what is happening here, does it mean there is an issue in loader.py in the local installation ?

@manili
Copy link

manili commented Nov 11, 2022

I also figured out that we need to sudo apt install pkg-config and sudo pip3 install textx on a fresh Ubuntu 22.04 to build and install from the source.
Note that Cython could be installed either from apt (as you mentioned) or sudo pip3 install Cython.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants