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

Does not install on mac with homebrew python #36

Closed
winni2k opened this issue Apr 5, 2018 · 12 comments
Closed

Does not install on mac with homebrew python #36

winni2k opened this issue Apr 5, 2018 · 12 comments

Comments

@winni2k
Copy link

winni2k commented Apr 5, 2018

When I follow the installation instructions on my mac OS 10.13.4 using the following command:

pushd /usr/local/bin 
ln -s pip3 pip
popd
curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python3

then I get the following error message:

Retrieving metadata

Installing version: 0.7.0
  - Getting dependencies
Traceback (most recent call last):
  File "<stdin>", line 259, in <module>
  File "<stdin>", line 255, in main
  File "<stdin>", line 165, in run
  File "<stdin>", line 175, in install
  File "<stdin>", line 233, in call
  File "/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 336, in check_output
    **kwargs).stdout
  File "/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '('pip', 'install', 'poetry==0.7.0', '--target', '/var/folders/py/9zg6845j2gb664dqkw24wn4w0000gn/T/poetry-installer-toi2v75x/dist')' returned non-zero exit status 2.

I tried installing the package via pip3 directly, but that does not install a poetry executable. If instead I try to run the package`s main function then I get this error message:

$ python3 -mpoetry
/usr/local/opt/python/bin/python3.6: No module named poetry.__main__; 'poetry' is a package and cannot be directly executed

Any ideas on how to get this to work?

@winni2k
Copy link
Author

winni2k commented Apr 5, 2018

PS I am running under Fish

@sdispater
Copy link
Member

Which pip version do you have?

@winni2k
Copy link
Author

winni2k commented Apr 6, 2018

$ pip --version
pip 9.0.3 from /usr/local/lib/python3.6/site-packages (python 3.6)

@sdispater
Copy link
Member

Could you download the get-poetry.py and execute it directly? To see if that changes things.

@winni2k
Copy link
Author

winni2k commented Apr 7, 2018

$ python3 get-poetry.py 
Retrieving metadata

Installing version: 0.7.1
  - Getting dependencies
Traceback (most recent call last):
  File "get-poetry.py", line 259, in <module>
    sys.exit(main())
  File "get-poetry.py", line 255, in main
    return installer.run()
  File "get-poetry.py", line 165, in run
    return self.install(version)
  File "get-poetry.py", line 175, in install
    '--target', str(dist)
  File "get-poetry.py", line 233, in call
    return subprocess.check_output(args, stderr=subprocess.STDOUT)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 336, in check_output
    **kwargs).stdout
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '('pip', 'install', 'poetry==0.7.1', '--target', '/var/folders/py/9zg6845j2gb664dqkw24wn4w0000gn/T/poetry-installer-d4rwp_fs/dist')' returned non-zero exit status 2.

$ pip --version
pip 9.0.3 from /usr/local/lib/python3.6/site-packages (python 3.6)

@sdispater
Copy link
Member

I just updated the get-poetry.py script to get more detail about the error.

Could you reexecute it to see what the pip error actually is?

curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python

@winni2k
Copy link
Author

winni2k commented Apr 8, 2018

curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python3
Retrieving metadata

Installing version: 0.7.1
  - Getting dependencies
An error has occured: Command '('pip', 'install', 'poetry==0.7.1', '--target', '/var/folders/py/9zg6845j2gb664dqkw24wn4w0000gn/T/poetry-installer-o2j1mx7c/dist')' returned non-zero exit status 2.
b'Collecting poetry==0.7.1\n  Using cached poetry-0.7.1-py3-none-any.whl\nCollecting pip-tools<2.0.0.0,>=1.11.0.0 (from poetry==0.7.1)\n  Using cached pip_tools-1.11.0-py2.py3-none-any.whl\nCollecting requests-toolbelt<0.9.0.0,>=0.8.0.0 (from poetry==0.7.1)\n  Using cached requests_toolbelt-0.8.0-py2.py3-none-any.whl\nCollecting pyrsistent<0.15.0.0,>=0.14.2.0 (from poetry==0.7.1)\nCollecting requests<3.0.0.0,>=2.18.0.0 (from poetry==0.7.1)\n  Using cached requests-2.18.4-py2.py3-none-any.whl\nCollecting pyparsing<3.0.0.0,>=2.2.0.0 (from poetry==0.7.1)\n  Using cached pyparsing-2.2.0-py2.py3-none-any.whl\nCollecting cachy<0.2.0.0,>=0.1.1.0 (from poetry==0.7.1)\n  Using cached cachy-0.1.1-py2.py3-none-any.whl\nCollecting cleo<0.7.0.0,>=0.6.0.0 (from poetry==0.7.1)\n  Using cached cleo-0.6.5-py2.py3-none-any.whl\nCollecting toml<0.10.0.0,>=0.9.0.0 (from poetry==0.7.1)\nCollecting jsonschema<3.0.0.0,>=2.6.0.0 (from poetry==0.7.1)\n  Using cached jsonschema-2.6.0-py2.py3-none-any.whl\nCollecting six (from pip-tools<2.0.0.0,>=1.11.0.0->poetry==0.7.1)\n  Using cached six-1.11.0-py2.py3-none-any.whl\nCollecting first (from pip-tools<2.0.0.0,>=1.11.0.0->poetry==0.7.1)\n  Using cached first-2.0.1-py2.py3-none-any.whl\nCollecting click>=6 (from pip-tools<2.0.0.0,>=1.11.0.0->poetry==0.7.1)\n  Using cached click-6.7-py2.py3-none-any.whl\nCollecting setuptools (from pip-tools<2.0.0.0,>=1.11.0.0->poetry==0.7.1)\n  Using cached setuptools-39.0.1-py2.py3-none-any.whl\nCollecting certifi>=2017.4.17 (from requests<3.0.0.0,>=2.18.0.0->poetry==0.7.1)\n  Using cached certifi-2018.1.18-py2.py3-none-any.whl\nCollecting urllib3<1.23,>=1.21.1 (from requests<3.0.0.0,>=2.18.0.0->poetry==0.7.1)\n  Using cached urllib3-1.22-py2.py3-none-any.whl\nCollecting chardet<3.1.0,>=3.0.2 (from requests<3.0.0.0,>=2.18.0.0->poetry==0.7.1)\n  Using cached chardet-3.0.4-py2.py3-none-any.whl\nCollecting idna<2.7,>=2.5 (from requests<3.0.0.0,>=2.18.0.0->poetry==0.7.1)\n  Using cached idna-2.6-py2.py3-none-any.whl\nCollecting pylev<2.0.0.0,>=1.3.0.0 (from cleo<0.7.0.0,>=0.6.0.0->poetry==0.7.1)\n  Using cached pylev-1.3.0-py2.py3-none-any.whl\nCollecting pastel<0.2.0.0,>=0.1.0.0 (from cleo<0.7.0.0,>=0.6.0.0->poetry==0.7.1)\n  Using cached pastel-0.1.0-py3-none-any.whl\nInstalling collected packages: six, first, click, setuptools, pip-tools, certifi, urllib3, chardet, idna, requests, requests-toolbelt, pyrsistent, pyparsing, cachy, pylev, pastel, cleo, toml, jsonschema, poetry\nException:\nTraceback (most recent call last):\n  File "/usr/local/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main\n    status = self.run(options, args)\n  File "/usr/local/lib/python3.6/site-packages/pip/commands/install.py", line 342, in run\n    prefix=options.prefix_path,\n  File "/usr/local/lib/python3.6/site-packages/pip/req/req_set.py", line 784, in install\n    **kwargs\n  File "/usr/local/lib/python3.6/site-packages/pip/req/req_install.py", line 851, in install\n    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)\n  File "/usr/local/lib/python3.6/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files\n    isolated=self.isolated,\n  File "/usr/local/lib/python3.6/site-packages/pip/wheel.py", line 247, in move_wheel_files\n    prefix=prefix,\n  File "/usr/local/lib/python3.6/site-packages/pip/locations.py", line 153, in distutils_scheme\n    i.finalize_options()\n  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/install.py", line 248, in finalize_options\n    "must supply either home or prefix/exec-prefix -- not both")\ndistutils.errors.DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both\n'

After running the last line through echo -e I get this output:

Collecting poetry==0.7.1
  Using cached poetry-0.7.1-py3-none-any.whl
Collecting pip-tools<2.0.0.0,>=1.11.0.0 (from poetry==0.7.1)
  Using cached pip_tools-1.11.0-py2.py3-none-any.whl
Collecting requests-toolbelt<0.9.0.0,>=0.8.0.0 (from poetry==0.7.1)
  Using cached requests_toolbelt-0.8.0-py2.py3-none-any.whl
Collecting pyrsistent<0.15.0.0,>=0.14.2.0 (from poetry==0.7.1)
Collecting requests<3.0.0.0,>=2.18.0.0 (from poetry==0.7.1)
  Using cached requests-2.18.4-py2.py3-none-any.whl
Collecting pyparsing<3.0.0.0,>=2.2.0.0 (from poetry==0.7.1)
  Using cached pyparsing-2.2.0-py2.py3-none-any.whl
Collecting cachy<0.2.0.0,>=0.1.1.0 (from poetry==0.7.1)
  Using cached cachy-0.1.1-py2.py3-none-any.whl
Collecting cleo<0.7.0.0,>=0.6.0.0 (from poetry==0.7.1)
  Using cached cleo-0.6.5-py2.py3-none-any.whl
Collecting toml<0.10.0.0,>=0.9.0.0 (from poetry==0.7.1)
Collecting jsonschema<3.0.0.0,>=2.6.0.0 (from poetry==0.7.1)
  Using cached jsonschema-2.6.0-py2.py3-none-any.whl
Collecting six (from pip-tools<2.0.0.0,>=1.11.0.0->poetry==0.7.1)
  Using cached six-1.11.0-py2.py3-none-any.whl
Collecting first (from pip-tools<2.0.0.0,>=1.11.0.0->poetry==0.7.1)
  Using cached first-2.0.1-py2.py3-none-any.whl
Collecting click>=6 (from pip-tools<2.0.0.0,>=1.11.0.0->poetry==0.7.1)
  Using cached click-6.7-py2.py3-none-any.whl
Collecting setuptools (from pip-tools<2.0.0.0,>=1.11.0.0->poetry==0.7.1)
  Using cached setuptools-39.0.1-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests<3.0.0.0,>=2.18.0.0->poetry==0.7.1)
  Using cached certifi-2018.1.18-py2.py3-none-any.whl
Collecting urllib3<1.23,>=1.21.1 (from requests<3.0.0.0,>=2.18.0.0->poetry==0.7.1)
  Using cached urllib3-1.22-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests<3.0.0.0,>=2.18.0.0->poetry==0.7.1)
  Using cached chardet-3.0.4-py2.py3-none-any.whl
Collecting idna<2.7,>=2.5 (from requests<3.0.0.0,>=2.18.0.0->poetry==0.7.1)
  Using cached idna-2.6-py2.py3-none-any.whl
Collecting pylev<2.0.0.0,>=1.3.0.0 (from cleo<0.7.0.0,>=0.6.0.0->poetry==0.7.1)
  Using cached pylev-1.3.0-py2.py3-none-any.whl
Collecting pastel<0.2.0.0,>=0.1.0.0 (from cleo<0.7.0.0,>=0.6.0.0->poetry==0.7.1)
  Using cached pastel-0.1.0-py3-none-any.whl
Installing collected packages: six, first, click, setuptools, pip-tools, certifi, urllib3, chardet, idna, requests, requests-toolbelt, pyrsistent, pyparsing, cachy, pylev, pastel, cleo, toml, jsonschema, poetry
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/local/lib/python3.6/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/usr/local/lib/python3.6/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/usr/local/lib/python3.6/site-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/usr/local/lib/python3.6/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/usr/local/lib/python3.6/site-packages/pip/wheel.py", line 247, in move_wheel_files
    prefix=prefix,
  File "/usr/local/lib/python3.6/site-packages/pip/locations.py", line 153, in distutils_scheme
    i.finalize_options()
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/install.py", line 248, in finalize_options
    "must supply either home or prefix/exec-prefix -- not both")
distutils.errors.DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both

@sdispater
Copy link
Member

Apparently this is a known problem with Homberew Python. See: https://stackoverflow.com/a/24357384

I recommend using pyenv to manage your python versions.

@winni2k
Copy link
Author

winni2k commented Apr 9, 2018

Ok, as I don't have this problem with pipenv, I'll just stick with that for now.

I'll give poetry another shot when this issue gets resolved.

@sdispater
Copy link
Member

@winni2k I won't be able to resolve this issue since it is not caused by poetry but by how homebrew install Python versions.

@winni2k
Copy link
Author

winni2k commented Apr 9, 2018

Fair enough. The more I read about homebrew python, the more it looks like pyenv is probably a saner solution.

@winni2k winni2k closed this as completed Apr 9, 2018
@winni2k winni2k changed the title Does not install on mac Does not install on mac with homebrew python Apr 10, 2018
dimbleby pushed a commit to dimbleby/poetry that referenced this issue Apr 21, 2022
…rs-fixes

Fix handling of dependency markers with python precision >= 3
Copy link

github-actions bot commented Mar 3, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants