{"action":"created","issue":{"url":"https://api.github.com/repos/pypa/pipenv/issues/1648","repository_url":"https://api.github.com/repos/pypa/pipenv","labels_url":"https://api.github.com/repos/pypa/pipenv/issues/1648/labels{/name}","comments_url":"https://api.github.com/repos/pypa/pipenv/issues/1648/comments","events_url":"https://api.github.com/repos/pypa/pipenv/issues/1648/events","html_url":"https://github.com/pypa/pipenv/issues/1648","id":304007592,"node_id":"MDU6SXNzdWUzMDQwMDc1OTI=","number":1648,"title":"Unable to install package in container","user":{"login":"sijis","id":618177,"node_id":"MDQ6VXNlcjYxODE3Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/618177?v=4","gravatar_id":"","url":"https://api.github.com/users/sijis","html_url":"https://github.com/sijis","followers_url":"https://api.github.com/users/sijis/followers","following_url":"https://api.github.com/users/sijis/following{/other_user}","gists_url":"https://api.github.com/users/sijis/gists{/gist_id}","starred_url":"https://api.github.com/users/sijis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sijis/subscriptions","organizations_url":"https://api.github.com/users/sijis/orgs","repos_url":"https://api.github.com/users/sijis/repos","events_url":"https://api.github.com/users/sijis/events{/privacy}","received_events_url":"https://api.github.com/users/sijis/received_events","type":"User","site_admin":false},"labels":[{"id":522150494,"node_id":"MDU6TGFiZWw1MjIxNTA0OTQ=","url":"https://api.github.com/repos/pypa/pipenv/labels/bug%20%F0%9F%90%9B","name":"bug 🐛","color":"ee0701","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":28,"created_at":"2018-03-09T23:01:20Z","updated_at":"2018-06-19T23:23:13Z","closed_at":"2018-03-10T18:38:00Z","author_association":"NONE","body":"I was troubleshooting an opened bug (https://github.com/pypa/pipenv/issues/1639) that I seem to have run into. In trying to reproduce it, it seems like i bumped into another issue.\r\n\r\nThis looks similar to the closed https://github.com/pypa/pipenv/issues/1441 issue, however, the command `virtualenv --python=python3 myenv` did not error out as anticipated in the comments.\r\n\r\n##### Expected result\r\n\r\nI expected to see a `Pipfile` and `Pipfile.lock` in the `/tmp/test1` directory.\r\n\r\n##### Actual result\r\n\r\nSaw the strack trace above.\r\n\r\n##### Steps to replicate\r\n\r\n```\r\n saviles  ~  1  docker run --rm -ti fedora:27 /bin/bash\r\n[root@0958ee759ab3 /]# dnf install -qy which\r\ninstall-info: No such file or directory for /usr/share/info/which.info.gz\r\n[root@0958ee759ab3 /]# pip3 install --user pipenv\r\nWARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.\r\nCollecting pipenv\r\n  Downloading pipenv-11.2.0.tar.gz (4.1MB)\r\n    100% |████████████████████████████████| 4.1MB 412kB/s \r\nCollecting setuptools>=36.2.1 (from pipenv)\r\n  Downloading setuptools-38.5.2-py2.py3-none-any.whl (490kB)\r\n    100% |████████████████████████████████| 491kB 2.3MB/s \r\nCollecting virtualenv (from pipenv)\r\n  Downloading virtualenv-15.1.0-py2.py3-none-any.whl (1.8MB)\r\n    100% |████████████████████████████████| 1.8MB 810kB/s \r\nCollecting virtualenv-clone>=0.2.5 (from pipenv)\r\n  Downloading virtualenv_clone-0.3.0-py2.py3-none-any.whl\r\nInstalling collected packages: setuptools, virtualenv, virtualenv-clone, pipenv\r\n  Running setup.py install for pipenv ... done\r\nSuccessfully installed pipenv-11.2.0 setuptools-38.5.2 virtualenv-15.1.0 virtualenv-clone-0.3.0\r\n[root@0958ee759ab3 /]# mkdir /tmp/test1\r\n[root@0958ee759ab3 /]# cd /tmp/test1\r\n[root@0958ee759ab3 test1]# python3 -m pipenv install requests\r\nWarning: the environment variable LANG is not set!\r\nWe recommend setting this in ~/.profile (or equivalent) for proper expected behavior.\r\nCreating a virtualenv for this project…\r\n⠋Using base prefix '/usr'\r\nNew python executable in /root/.local/share/virtualenvs/test1-MiVIN7Yf/bin/python3\r\nAlso creating executable in /root/.local/share/virtualenvs/test1-MiVIN7Yf/bin/python\r\nInstalling setuptools, pip, wheel...done.\r\n\r\nVirtualenv location: \r\nCreating a Pipfile for this project…\r\nTraceback (most recent call last):\r\n  File \"/usr/lib64/python3.6/runpy.py\", line 193, in _run_module_as_main\r\n    \"__main__\", mod_spec)\r\n  File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\r\n    exec(code, run_globals)\r\n  File \"/root/.local/lib/python3.6/site-packages/pipenv/__main__.py\", line 4, in <module>\r\n    cli()\r\n  File \"/root/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py\", line 722, in __call__\r\n    return self.main(*args, **kwargs)\r\n  File \"/root/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py\", line 697, in main\r\n    rv = self.invoke(ctx)\r\n  File \"/root/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py\", line 1066, in invoke\r\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\r\n  File \"/root/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py\", line 895, in invoke\r\n    return ctx.invoke(self.callback, **ctx.params)\r\n  File \"/root/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py\", line 535, in invoke\r\n    return callback(*args, **kwargs)\r\n  File \"/root/.local/lib/python3.6/site-packages/pipenv/cli.py\", line 197, in install\r\n    selective_upgrade=selective_upgrade\r\n  File \"/root/.local/lib/python3.6/site-packages/pipenv/core.py\", line 1767, in do_install\r\n    ensure_project(three=three, python=python, system=system, warn=True, deploy=deploy, skip_requirements=skip_requirements)\r\n  File \"/root/.local/lib/python3.6/site-packages/pipenv/core.py\", line 688, in ensure_project\r\n    ensure_pipfile(validate=validate, skip_requirements=skip_requirements)\r\n  File \"/root/.local/lib/python3.6/site-packages/pipenv/core.py\", line 341, in ensure_pipfile\r\n    project.create_pipfile(python=python)\r\n  File \"/root/.local/lib/python3.6/site-packages/pipenv/project.py\", line 439, in create_pipfile\r\n    data[u'requires'] = {'python_version': python_version(self.which('python'))[:len('2.7')]}\r\nTypeError: 'NoneType' object is not subscriptable\r\n```\r\n\r\n[root@0958ee759ab3 test1]# python3 -m pipenv.help            \r\nPipenv version: `'11.2.0'`\r\n\r\nPipenv location: `'/root/.local/lib/python3.6/site-packages/pipenv'`\r\n\r\nPython location: `'/usr/bin/python3'`\r\n\r\nOther Python installations in `PATH`:\r\n\r\n  - `3.6`: `/usr/bin/python3.6m`\r\n  - `3.6`: `/usr/bin/python3.6`\r\n  - `3.6`: `/bin/python3.6`\r\n\r\n  - `3.6.2`: `/usr/bin/python3`\r\n  - `3.6.2`: `/bin/python3`\r\n\r\nPEP 508 Information:\r\n\r\n```\r\n{'implementation_name': 'cpython',\r\n 'implementation_version': '3.6.2',\r\n 'os_name': 'posix',\r\n 'platform_machine': 'x86_64',\r\n 'platform_python_implementation': 'CPython',\r\n 'platform_release': '4.15.6-300.fc27.x86_64',\r\n 'platform_system': 'Linux',\r\n 'platform_version': '#1 SMP Mon Feb 26 18:43:03 UTC 2018',\r\n 'python_full_version': '3.6.2',\r\n 'python_version': '3.6',\r\n 'sys_platform': 'linux'}\r\n```\r\n\r\nSystem environment variables:\r\n\r\n  - `LS_COLORS`\r\n  - `HOSTNAME`\r\n  - `PWD`\r\n  - `HOME`\r\n  - `FBR`\r\n  - `DISTTAG`\r\n  - `FGC`\r\n  - `TERM`\r\n  - `SHLVL`\r\n  - `PATH`\r\n  - `_`\r\n  - `OLDPWD`\r\n  - `LC_CTYPE`\r\n  - `PIP_PYTHON_PATH`\r\n\r\nPipenv–specific environment variables:\r\n\r\n\r\nDebug–specific environment variables:\r\n\r\n  - `PATH`: `/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin`\r\n  - `PWD`: `/tmp/test1`\r\n\r\n\r\n---------------------------\r\n\r\nContents of `Pipfile` ('/tmp/test1/Pipfile'):\r\n\r\n```toml\r\n\r\n```\r\n```\r\n[root@0958ee759ab3 test1]# envname\r\nbash: envname: command not found\r\n[root@0958ee759ab3 test1]# virtualenv --python=python3 myenv\r\nbash: virtualenv: command not found\r\n[root@0958ee759ab3 test1]# python3 -m virtualenv --python=python3 myenv\r\nAlready using interpreter /usr/bin/python3\r\nUsing base prefix '/usr'\r\nNew python executable in /tmp/test1/myenv/bin/python3\r\nAlso creating executable in /tmp/test1/myenv/bin/python\r\nInstalling setuptools, pip, wheel...done.\r\n[root@0958ee759ab3 test1]# ls\r\nPipfile  myenv\r\n[root@0958ee759ab3 test1]# \r\n```\r\n(Edit: Formatting)"},"comment":{"url":"https://api.github.com/repos/pypa/pipenv/issues/comments/398576085","html_url":"https://github.com/pypa/pipenv/issues/1648#issuecomment-398576085","issue_url":"https://api.github.com/repos/pypa/pipenv/issues/1648","id":398576085,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODU3NjA4NQ==","user":{"login":"raleighlittles","id":2137201,"node_id":"MDQ6VXNlcjIxMzcyMDE=","avatar_url":"https://avatars1.githubusercontent.com/u/2137201?v=4","gravatar_id":"","url":"https://api.github.com/users/raleighlittles","html_url":"https://github.com/raleighlittles","followers_url":"https://api.github.com/users/raleighlittles/followers","following_url":"https://api.github.com/users/raleighlittles/following{/other_user}","gists_url":"https://api.github.com/users/raleighlittles/gists{/gist_id}","starred_url":"https://api.github.com/users/raleighlittles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raleighlittles/subscriptions","organizations_url":"https://api.github.com/users/raleighlittles/orgs","repos_url":"https://api.github.com/users/raleighlittles/repos","events_url":"https://api.github.com/users/raleighlittles/events{/privacy}","received_events_url":"https://api.github.com/users/raleighlittles/received_events","type":"User","site_admin":false},"created_at":"2018-06-19T23:23:13Z","updated_at":"2018-06-19T23:23:13Z","author_association":"NONE","body":"@techalchemy \r\n\r\n>looks to me like the issue is that you are trying to do this from / and you never made an app directory which breaks things, we just need a better error message\r\n\r\nCan you explain exactly what the resolution here is supposed to be? I tried adding\r\n\r\n```WORKDIR /app/``` into my dockerfile, but when I tried to install the dependencies with pipenv using a ```requirements.txt``` file, it said the folder was not found. \r\n\r\nHere's what my folder set up is:\r\n```\r\nrlittles@rlittles-linux1 (/home/rlittles/git_projects/pixel-mask-gen) (158018408-automate-bad-pixel-mask-generation) $ tree\r\n.\r\n├── 20180619-kb26_bpm.fits\r\n├── config.yml\r\n├── debug\r\n│   ├── 0_bpm.txt\r\n│   ├── 1_bpm.txt\r\n│   ├── 20180619-kb26_bpm.fits.txt\r\n│   ├── 2_bpm.txt\r\n│   └── combined_bpm_list.txt\r\n├── Dockerfile\r\n├── instructions.pdf\r\n├── LICENSE\r\n├── README.md\r\n├── requirements.txt\r\n├── script.py\r\n├── src\r\n│   ├── combine_images.py\r\n│   ├── create_bpm.py\r\n│   ├── fitsutils.py\r\n│   └── statistics.py\r\n├── test\r\n│   ├── __init__.py\r\n│   └── test_script.py\r\n└── TODO.md\r\n```\r\n\r\nand here's my Dockerfile:\r\n```\r\nFROM python:3\r\n\r\nWORKDIR /app/\r\n\r\nADD script.py /\r\n\r\nRUN pip install pipenv\r\n\r\nRUN pipenv --three\r\n\r\nRUN pipenv install -r app/requirements.txt\r\n\r\nCMD [\"pipenv\", \"run\", \"python3\", \"app/script.py\", \"app/config.yml\"]\r\n\r\n```\r\n\r\nThe way I run my script locally is just ```python3 script.py config.yml```, and my dependencies are stored in the ```requirements.txt``` file. How do I follow your instructions to be able to:\r\n1) Initialize a virtual environment in Python using pipenv\r\n2) Install the already-defined dependencies listed in requirements.txt\r\n\r\nso that I can use pipenv to execute my Python script in the virtual environment.\r\n\r\n\r\nThanks in advance."}}
{"actor":{"display_login":"raleighlittles"}}