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

Error on windows? only #31

Closed
mahoromax opened this issue Oct 14, 2022 · 4 comments
Closed

Error on windows? only #31

mahoromax opened this issue Oct 14, 2022 · 4 comments
Assignees
Labels
bug Something isn't working ready Done/implemented, but release still pending

Comments

@mahoromax
Copy link

After creating a fresh venv on a windows system with python 3.10, installing codemetapy and executing it on a cloned repo I get the following error:

No input files specified, but found python project (pyproject.toml) in current dir, using that...
Downloading context from https://raw.githubusercontent.com/codemeta/codemeta/2.0/codemeta.jsonld
Traceback (most recent call last):
  File "C:\git\codemetapytest\.venv\Scripts\codemetapy-script.py", line 33, in <module>
    sys.exit(load_entry_point('CodeMetaPy==2.2.2', 'console_scripts', 'codemetapy')())
  File "C:\git\codemetapytest\.venv\lib\site-packages\codemeta\codemeta.py", line 136, in main
    g, res, args, contextgraph = build(**args.__dict__)
  File "C:\git\codemetapytest\.venv\lib\site-packages\codemeta\codemeta.py", line 263, in build
    g, contextgraph = init_graph(args.no_cache)
  File "C:\git\codemetapytest\.venv\lib\site-packages\codemeta\common.py", line 275, in init_graph
    init_context(no_cache)
  File "C:\git\codemetapytest\.venv\lib\site-packages\codemeta\common.py", line 257, in init_context
    with open(localfile, 'wb') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp\\codemeta.jsonld'

The last line makes me think that this is an error about combining unix and windows filepath delimiters?

@proycon
Copy link
Owner

proycon commented Oct 14, 2022

The culprit was TMPDIR which was not set with non-unix systems in mind. I have now addressed it in the above commit. Could you try again from the latest git master tree? (I can't rule out there may be similar issues elsewhere yet)

@proycon proycon self-assigned this Oct 14, 2022
@proycon proycon added bug Something isn't working ready Done/implemented, but release still pending labels Oct 14, 2022
@mahoromax
Copy link
Author

I'm encountering the following error when trying to install from source code:

Using legacy 'setup.py install' for CodeMetaPy, since package 'wheel' is not installed.
Installing collected packages: webencodings, wcwidth, nameparser, zipp, urllib3, tomli, soupsieve, six, pyyaml, pyparsing, prettytable, MarkupSafe, lxml, idna, charset-normalizer, certifi, requests, pep517, packaging, Jinja2, isodate, importlib_metadata, html5lib, BeautifulSoup4, rdflib, owlrl, pyshacl, CodeMetaPy
  Running setup.py install for CodeMetaPy ... error
  error: subprocess-exited-with-error

  × Running setup.py install for CodeMetaPy did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\temp\codemetapy\setup.py", line 6, in <module>
          from codemeta.codemeta import CodeMetaCommand
        File "C:\temp\codemetapy\codemeta\codemeta.py", line 88, in <module>
          props, crosswalk = codemeta.crosswalk.readcrosswalk()
        File "C:\temp\codemetapy\codemeta\crosswalk.py", line 28, in readcrosswalk
          with open(crosswalkfile, 'r', encoding="utf-8") as f:
      FileNotFoundError: [Errno 2] No such file or directory: 'C:\\temp\\codemetapy\\codemeta\\schema\\crosswalk.csv'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> CodeMetaPy

I noticed that the referenced file 'crosswalk.csv' was not checked out with master, so I downloaded it from https://github.com/codemeta/codemeta/tree/22cf4c2b836a0026565792b5d1b3c5ff6c1fc82b and added it manually, which enabled the installation.

After that I could successfully execute codemetapy on the repository that failed before.

@proycon
Copy link
Owner

proycon commented Oct 14, 2022

Make sure to use the --recursive option with git clone to clone all the git submodules, you were missing the codemeta repo in codemeta/schema.

The instructions should probably be updated to communicate this better.

@mahoromax
Copy link
Author

Oh yeah, I did not notice there was a submodule present. That explains. I wanted to keep this open in case there was something else to fix, but that means this issue is solved.

Thank you for the fast reaction!
Now I just need to learn to provide good metadata in my projects :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready Done/implemented, but release still pending
Projects
None yet
Development

No branches or pull requests

2 participants