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

Can't install jamdict_data with pip #1

Open
adamkolar opened this issue Jun 26, 2023 · 2 comments · May be fixed by #2
Open

Can't install jamdict_data with pip #1

adamkolar opened this issue Jun 26, 2023 · 2 comments · May be fixed by #2

Comments

@adamkolar
Copy link

Hey, I'm not sure this belongs here, but I don't know where else to report this, I've been trying to install jamdict-data with pip and got this error message, tried restarting computer and running the command as admin, but no luck:

D:\>pip install jamdict-data
Collecting jamdict-data
  Using cached jamdict_data-1.5.tar.gz (53.9 MB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: jamdict-data
  Building wheel for jamdict-data (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [3 lines of output]
      running bdist_wheel
      error: [WinError 32] The process cannot access the file because it is being used by another process: 'jamdict_data/jamdict.db.xz'
      Unpacking database from C:\Users\adamk\AppData\Local\Temp\pip-install-0g5jo6wa\jamdict-data_b070aea1c93145daa6db552e802ff608\jamdict_data\jamdict.db.xz to C:\Users\adamk\AppData\Local\Temp\pip-install-0g5jo6wa\jamdict-data_b070aea1c93145daa6db552e802ff608\jamdict_data\jamdict.db
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for jamdict-data
  Running setup.py clean for jamdict-data
Failed to build jamdict-data
ERROR: Could not build wheels for jamdict-data, which is required to install pyproject.toml-based projects

@dbrwn
Copy link

dbrwn commented Jul 16, 2023

I can reproduce this on Windows, but it seems to work fine on Linux. I haven't tried on macOS.
The problem seems to be related this:

jamdict_data/setup.py

Lines 27 to 32 in f9c39bd

with lzma.open(ZIPPED_DB) as f:
db_content = f.read()
with open(TARGET_DB, "wb") as out:
out.write(db_content)
# delete the xz file
os.unlink("jamdict_data/jamdict.db.xz")

The ZIPPED_DB resource is trying to be unlinked/deleted from within the with block it was opened using.
If the os.unlink() is made outside the with, the install finishes on Windows.

@Kimeiga
Copy link

Kimeiga commented Jan 4, 2024

i also just hit this on windows but just moved my whole project to wsl to compensate. cheers to dbrwn for figuring it out :)

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

Successfully merging a pull request may close this issue.

3 participants