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

Unexpected behavior with virtualenvs #424

Open
dougransom opened this issue Jul 23, 2021 · 6 comments
Open

Unexpected behavior with virtualenvs #424

dougransom opened this issue Jul 23, 2021 · 6 comments

Comments

@dougransom
Copy link

On windows,
flit install
flit install --symlink
flit install --env
flit install --python = c:\users\dougr\onedrive\doug\codingprojects\dt\nl\scripts\python.exe

All install in the base python instead of the virtual environment.

The workaround is

 flit build --no-setup-py
 pip install .\dist\natlink-0.0.0.1.8-py3-none-any.whl

which is rather cumbersome.

More information on python (from the [pyenvutils](https://pypi.org/project/pyenvutils/ module also packaged with flit).

Platform: "win32"
Python version: "3.8"
Current installation scheme: "nt"

Paths:
        data = "c:\users\dougr\onedrive\doug\codingprojects\dt\nl"
        include = "C:\Python38-32\Include"
        platinclude = "C:\Python38-32\Include"
        platlib = "c:\users\dougr\onedrive\doug\codingprojects\dt\nl\Lib\site-packages"
        platstdlib = "c:\users\dougr\onedrive\doug\codingprojects\dt\nl\Lib"
        purelib = "c:\users\dougr\onedrive\doug\codingprojects\dt\nl\Lib\site-packages"
        scripts = "c:\users\dougr\onedrive\doug\codingprojects\dt\nl\Scripts"
        stdlib = "C:\Python38-32\Lib"

Variables:
        BINDIR = "C:\Users\dougr\OneDrive\doug\codingprojects\dt\nl\Scripts"
        BINLIBDEST = "c:\users\dougr\onedrive\doug\codingprojects\dt\nl\Lib"
        EXE = ".exe"
        EXT_SUFFIX = ".cp38-win32.pyd"
        INCLUDEPY = "C:\Python38-32\Include"
        LIBDEST = "C:\Python38-32\Lib"
        SO = ".cp38-win32.pyd"
        VERSION = "38"
        abiflags = ""
        base = "c:\users\dougr\onedrive\doug\codingprojects\dt\nl"
        exec_prefix = "c:\users\dougr\onedrive\doug\codingprojects\dt\nl"
        installed_base = "C:\Python38-32"
        installed_platbase = "C:\Python38-32"
        platbase = "c:\users\dougr\onedrive\doug\codingprojects\dt\nl"
        prefix = "c:\users\dougr\onedrive\doug\codingprojects\dt\nl"
        projectbase = "C:\Users\dougr\OneDrive\doug\codingprojects\dt\nl\Scripts"
        py_version = "3.8.10"
        py_version_nodot = "38"
        py_version_short = "3.8"
        srcdir = "C:\Users\dougr\OneDrive\doug\codingprojects\dt\nl\Scripts"
        userbase = "C:\Users\dougr\AppData\Roaming\Python"
(nl) PS C:\users\dougr\OneDrive\doug\codingprojects\dt\natlinkkb100\natlink>
@takluyver
Copy link
Member

Hmm. I've got a feeling I remember that there's something odd about the way virtualenvs work on Windows, but I don't remember what it is. 😕

Does pip install . work? That should now automatically make a wheel and then install it for you. One day, flit install will probably go away in favour of using pip directly.

@dougransom
Copy link
Author

dougransom commented Aug 5, 2021 via email

@takluyver
Copy link
Member

There's work towards a standardised mechanism for editable installs, so pip install -e . will work - this is PEP 660, and PR #400 here.

That said, I may still keep the symlink trick around, so long as it's not too much work to maintain, because it appeals to me more than the .pth files we'll use for the standardised hook.

@dougransom
Copy link
Author

dougransom commented Aug 6, 2021 via email

@takluyver
Copy link
Member

I'm not aware of anything like that; let me know if you find/make one. 🙂

@dougransom
Copy link
Author

I'm not aware of anything like that; let me know if you find/make one. 🙂

Hm. I think most if the information for a published package on pypi is available through this api:

https://warehouse.readthedocs.io/api-reference/json.html#project

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