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 not generate Pipfile.lock by installing packages with requirementx.txt on Python 2.7 #2449

Closed
adhh852 opened this issue Jun 27, 2018 · 0 comments

Comments

@adhh852
Copy link

adhh852 commented Jun 27, 2018

Describe the issue briefly here.
Run: $pipenv install -r requirements.txt
Got error:
Creating a virtualenv for this project...
Pipfile: /home/ec2-user/test/Pipfile
Using /usr/bin/python2.7 (2.7.14) to create virtualenv...
⠋Already using interpreter /usr/bin/python2.7
New python executable in /home/ec2-user/.local/share/virtualenvs/test-LVXQY0Nl/bin/python2.7
Also creating executable in /home/ec2-user/.local/share/virtualenvs/test-LVXQY0Nl/bin/python
Installing setuptools, pip, wheel...done.
Setting project for test-LVXQY0Nl to /home/ec2-user/test

Virtualenv location: /home/ec2-user/.local/share/virtualenvs/test-LVXQY0Nl
Creating a Pipfile for this project...
Requirements file provided! Importing into Pipfile...
Traceback (most recent call last):
File "/usr/local/bin/pipenv", line 11, in
sys.exit(cli())
File "/usr/local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/pipenv/cli.py", line 416, in install
selective_upgrade=selective_upgrade,
File "/usr/local/lib/python2.7/site-packages/pipenv/core.py", line 1854, in do_install
import_requirements(r=project.path_to(requirements), dev=dev)
File "/usr/local/lib/python2.7/site-packages/pipenv/core.py", line 228, in import_requirements
project.recase_pipfile()
File "/usr/local/lib/python2.7/site-packages/pipenv/project.py", line 766, in recase_pipfile
if self.ensure_proper_casing():
File "/usr/local/lib/python2.7/site-packages/pipenv/project.py", line 802, in ensure_proper_casing
casing_changed = self.proper_case_section(pfile.get('packages', {}))
File "/usr/local/lib/python2.7/site-packages/pipenv/project.py", line 826, in proper_case_section
self.register_proper_name(new_casing)
File "/usr/local/lib/python2.7/site-packages/pipenv/project.py", line 366, in register_proper_name
f.write('{0}\n'.format(name))
TypeError: write() argument 1 must be unicode, not str
/usr/local/lib/python2.7/site-packages/pipenv/_compat.py:108: ResourceWarning: Implicitly cleaning up <TemporaryDirectory '/tmp/pipenv-2ttppI-requirements'>
warnings.warn(warn_message, ResourceWarning)

Please run $ python -m pipenv.help, and paste the results here.

$ python -m pipenv.help output

Pipenv version: '2018.6.25'

Pipenv location: '/usr/local/lib/python2.7/site-packages/pipenv'

Python location: '/usr/bin/python'

Other Python installations in PATH:

  • 2.7: /usr/bin/python2.7

  • 2.7: /usr/bin/python2.7

  • 2.7.14: /usr/bin/python

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '0',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.14.33-51.37.amzn1.x86_64',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP Thu May 3 20:07:43 UTC 2018',
 'python_full_version': '2.7.14',
 'python_version': '2.7',
 'sys_platform': 'linux2'}

System environment variables:

  • LC_CTYPE
  • PYTHONDONTWRITEBYTECODE
  • LESSOPEN
  • SSH_CLIENT
  • LOGNAME
  • USER
  • HOME
  • PATH
  • AWS_PATH
  • LANG
  • LESS_TERMCAP_se
  • TERM
  • SHELL
  • EC2_AMITOOL_HOME
  • LESS_TERMCAP_me
  • LESS_TERMCAP_md
  • LESS_TERMCAP_mb
  • HISTSIZE
  • AWS_ELB_HOME
  • JAVA_HOME
  • EC2_HOME
  • AWS_AUTO_SCALING_HOME
  • PIP_PYTHON_PATH
  • _
  • LESS_TERMCAP_ue
  • SSH_CONNECTION
  • AWS_CLOUDWATCH_HOME
  • SSH_TTY
  • OLDPWD
  • HOSTNAME
  • HISTCONTROL
  • SHLVL
  • PWD
  • LESS_TERMCAP_us
  • MAIL
  • LS_COLORS

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/aws/bin:/home/ec2-user/.local/bin:/home/ec2-user/bin
  • SHELL: /bin/bash
  • LANG: en_US.UTF-8
  • PWD: /home/ec2-user/test

Contents of Pipfile ('/home/ec2-user/test/Pipfile'):

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[dev-packages]

[packages]
flask = "==0.10.1"
"jinja2" = "==2.7.3"
werkzeug = "==0.10"

[requires]
python_version = "2.7"
If you're on MacOS, just run the following:
$ python -m pipenv.help | pbcopy

Expected result

Describe what you expected.

Actual result

When possible, provide the verbose output (--verbose), especially for locking and dependencies resolving issues.

sybrenstuvel added a commit to sybrenstuvel/python-rsa that referenced this issue Sep 16, 2018
We still test with 'pypy3.5'. However, Pipenv has an issue with pypy 2.7.
See pypa/pipenv#2449
sybrenstuvel added a commit to sybrenstuvel/python-rsa that referenced this issue Sep 16, 2018
- Remove `--ignore-pipfile`. This option makes Pipenv install from the
  `Pipfile.lock` only, ignoring the `Pipfile` itself. In a sense this is
  good, because it tests with the locked dependencies. However, it
  breaks when you lock on Python 3.6 but test on Python 3.4 or 2.7.
  We'll have to re-visit this when dropping support for older Pythons.

- pypy 3.6 -> 3.5

- Drop `pypy` from Travis CI testing
  We still test with 'pypy3.5'. However, Pipenv has an issue with pypy 2.7.
  See pypa/pipenv#2449

- Pypy3.5 seems to want pathlib2 when running on Travis CI
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

1 participant