-
Notifications
You must be signed in to change notification settings - Fork 243
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
pipenv support #82
Comments
Python program running on wine yet writing to filesystem on linux through pipe fails 😕 I don't know what is the exact issue here. Simple step to reproduce with wineroot@53f599a5903b:/src# python -c 'print("Hello World")' > output.txt
Fatal Python error: init_sys_streams: can't initialize sys standard streams
OSError: [WinError 6] Invalid handle
Current thread 0x0000002e (most recent call first):
abnormal program termination I thought I just install pipenv and write requirements.txt file if there is Pipfile in CWD, but not working because of above issue. Simply install pipenv like that, ...
# install python in wine, using the msi packages to install, extracting
# the files directly, since installing isn't running correctly.
RUN set -x \
&& winetricks win7 \
&& for msifile in `echo core dev exe lib path pip tcltk tools`; do \
wget -nv "https://www.python.org/ftp/python/$PYTHON_VERSION/amd64/${msifile}.msi"; \
wine msiexec /i "${msifile}.msi" /qb TARGETDIR=C:/Python37; \
rm ${msifile}.msi; \
done \
&& cd /wine/drive_c/Python37 \
&& wine python.exe -m pip install -U pipenv \
&& echo 'wine '\''C:\Python37\python.exe'\'' "$@"' > /usr/bin/python \
&& echo 'wine '\''C:\Python37\Scripts\easy_install.exe'\'' "$@"' > /usr/bin/easy_install \
&& echo 'wine '\''C:\Python37\Scripts\pip.exe'\'' "$@"' > /usr/bin/pip \
&& echo 'wine '\''C:\Python37\Scripts\pyinstaller.exe'\'' "$@"' > /usr/bin/pyinstaller \
&& echo 'wine '\''C:\Python37\Scripts\pyupdater.exe'\'' "$@"' > /usr/bin/pyupdater \
&& echo 'wine '\''C:\Python37\Scripts\pipenv.exe'\'' "$@"' > /usr/bin/pipenv \
&& echo 'assoc .py=PythonScript' | wine cmd \
&& echo 'ftype PythonScript=c:\Python37\python.exe "%1" %*' | wine cmd \
&& while pgrep wineserver >/dev/null; do echo "Waiting for wineserver"; sleep 1; done \
&& chmod +x /usr/bin/python /usr/bin/easy_install /usr/bin/pip /usr/bin/pyinstaller /usr/bin/pyupdater /usr/bin/pipenv \
&& (pip install -U pip || true) \
&& rm -rf /tmp/.wine-*
... and check Pipfile from ...
if [ -f Pipfile ]; then
pipenv lock -r > requirements.txt # failed to work here
pip install -r requirements.txt
rm requirements.txt
fi # [ -f Pipfile ] ]
if [ -f requirements.txt ]; then
pip install -r requirements.txt
fi # [ -f requirements.txt ]
... manual execution goes like this; [kesuskim@localhost project]$ docker run -it --rm -v $PWD:/src --entrypoint /bin/bash test:latest
root@53f599a5903b:/src# pipenv lock -r > requirements.txt
Fatal Python error: init_sys_streams: can't initialize sys standard streams
OSError: [WinError 6] Invalid handle
Current thread 0x0000002c (most recent call first):
abnormal program termination |
Hey, @kesuskim I've just discovered this repo and would also love to add pipenv support to this script. |
Hello @zamai ! :) I'd love to work with this to make it with pipenv seamlessly, but for now I have to do just make it work so I manually extract requirements.txt file and do build ;( |
I see, don't have an inspiration to figgure out the windows stdout handling, so my solution to the problem is a Make command:
|
Yes, that could be one workaround at application level, too! I hope one day the problem can be resolved :) |
Hello, First of all I am really thankful for the project. I was about to crazy and about to build my own version of docker.
( It seems coexistence of Python2 and Python3 within Windows makes build environment unstable or add side effect something I don't even know what causes problem; I must use Python2 for another build tools depending on it which not even using Python at all, and for Python development we now must use Python3 because Python2 is now deprecated. It is horrible )
Anyway, I think it is really good to support pipenv, as pipenv seems official and very mature, reasonable tool we can use in Python dev.
Just as this project already has support for detection of requirements.txt file, so does Pipfile can make this things through.
I will test some things and send PR.
The text was updated successfully, but these errors were encountered: