I installed cookiecutter using
`conda install cookiecutter`
but when I try to import the repo from git hub using
`cookiecutter https://github.com/drivendata/cookiecutter-data-science`
I got the following error message:
{
Traceback (most recent call last):
File "C:\Users\iamuraptha\Anaconda3\Scripts\cookiecutter-script.py", line 5, in <module>
sys.exit(cookiecutter.cli.main())
File "C:\Users\iamuraptha\Anaconda3\lib\site-packages\click\core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "C:\Users\iamuraptha\Anaconda3\lib\site-packages\click\core.py", line 697, in main
rv = self.invoke(ctx)
File "C:\Users\iamuraptha\Anaconda3\lib\site-packages\click\core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\iamuraptha\Anaconda3\lib\site-packages\click\core.py", line 535, in invoke
return callback(*args, **kwargs)
File "C:\Users\iamuraptha\Anaconda3\lib\site-packages\cookiecutter\cli.py", line 120, in main
password=os.environ.get('COOKIECUTTER_REPO_PASSWORD')
File "C:\Users\iamuraptha\Anaconda3\lib\site-packages\cookiecutter\main.py", line 63, in cookiecutter
password=password
File "C:\Users\iamuraptha\Anaconda3\lib\site-packages\cookiecutter\repository.py", line 103, in determine_repo_dir
no_input=no_input,
File "C:\Users\iamuraptha\Anaconda3\lib\site-packages\cookiecutter\vcs.py", line 99, in clone
stderr=subprocess.STDOUT,
File "C:\Users\iamuraptha\Anaconda3\lib\subprocess.py", line 336, in check_output
**kwargs).stdout
File "C:\Users\iamuraptha\Anaconda3\lib\subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['git', 'clone', 'https://github.com/drivendata/cookiecutter-data-science']' returned non-zero exit status 128.
}
You need something git can clone. Use https://github.com/drivendata/cookiecutter-data-science.git (this is the link you get when you click the 'clone or download' button in Github)
I just wanted to add a clarification for people coming here because they have a somewhat similar problem. The problem is not that the address isn't a valid git link. You can give cookiecutter a regular URL to a github repo and it will work, provided the directory in which cookiecooker is installed is in your environment's path. I'm not on Windows so I can't confirm, but check the documentation for more details about adjusting the path. And remember to factor Anaconda in if you are using it instead of the system Python.
For me this was a straightforward process on a Mac because I followed the prompt when I installed Anaconda, but I needed to add the path manually on Ubuntu machine
I installed the package like you did above:
conda install cookiecutter
Waited until the installation happened and then used:
cookiecutter https://github.com/drivendata/cookiecutter-data-science
I got the following output
project_name [project_name]: Fred
repo_name [Fred]: Fred
author_name [Your name (or your organization/company/team)]: Joseph
Cunningham
description [A short description of the project.]: test
Select open_source_license:
1 - MIT
2 - BSD-3-Clause
3 - No license file
Choose from 1, 2, 3 [1]: 3
s3_bucket [[OPTIONAL] your-bucket-for-syncing-data (do not include
's3://')]:
aws_profile [default]:
Select python_interpreter:
1 - python
2 - python3
Choose from 1, 2 [1]: 2
The people above are saying it is not a valid git but it worked for me.
I was behind a corporate firewall which prevented me from using
'cookiecutter https://github.com/drivendata/cookiecutter-data-science'
This may be an issue for someone else who lands up here.
Related
I am on Windows 10 running Python 3.7.
I am trying to install a Python package on one of my private GitHub repositories. I want to use the GitHub deploy key to give only read access to the single repository.
So I generated the deploy key using
ssh-keygen -t rsa -b 4096 -C "email#domain.com"
This added the private and public key to the .ssh folder on my user machine. I then copied the public key to the deploy keys for my private GitHub python package repository.
Then I generated a virtualenv and tried to run the command
pip install git+ssh://git#github.com/<github_username>/<repo_name>.git
but I keep getting an error saying
ERROR: Command errored out with exit status 128: git clone -q 'ssh://****#github.com/<github_username>/<repo_name>.git' 'C:\Users\Alex\AppData\Local\Temp\pip-req-build-doj1og3o' Check the logs for full command output.
I've looked at other posts with the similar issue and as far as I can tell my syntax for the installation command is correct.
Here is my error log output:
2020-10-13T09:36:22,708 Using pip 20.2.3 from c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip (python 3.7)
2020-10-13T09:36:22,710 Non-user install because user site-packages disabled
2020-10-13T09:36:22,718 Created temporary directory: C:\Users\Alex\AppData\Local\Temp\pip-ephem-wheel-cache-35_xjrvi
2020-10-13T09:36:22,719 Created temporary directory: C:\Users\Alex\AppData\Local\Temp\pip-req-tracker-6m9f9yue
2020-10-13T09:36:22,719 Initialized build tracking at C:\Users\Alex\AppData\Local\Temp\pip-req-tracker-6m9f9yue
2020-10-13T09:36:22,719 Created build tracker: C:\Users\Alex\AppData\Local\Temp\pip-req-tracker-6m9f9yue
2020-10-13T09:36:22,721 Entered build tracker: C:\Users\Alex\AppData\Local\Temp\pip-req-tracker-6m9f9yue
2020-10-13T09:36:22,722 Created temporary directory: C:\Users\Alex\AppData\Local\Temp\pip-install-wco_t2va
2020-10-13T09:36:22,730 Collecting git+ssh://****#github.com/<github_username>/<repo_name>.git
2020-10-13T09:36:22,731 Created temporary directory: C:\Users\Alex\AppData\Local\Temp\pip-req-build-21n7avhs
2020-10-13T09:36:22,732 Cloning ssh://****#github.com/<github_username>/<repo_name>.git to c:\users\alex\appdata\local\temp\pip-req-build-21n7avhs
2020-10-13T09:36:23,013 ERROR: Command errored out with exit status 128: git clone -q 'ssh://****#github.com/<github_username>/<repo_name>.git' 'C:\Users\Alex\AppData\Local\Temp\pip-req-build-21n7avhs' Check the logs for full command output.
2020-10-13T09:36:23,016 Exception information:
2020-10-13T09:36:23,016 Traceback (most recent call last):
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\cli\base_command.py", line 228, in _main
2020-10-13T09:36:23,016 status = self.run(options, args)
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\cli\req_command.py", line 182, in wrapper
2020-10-13T09:36:23,016 return func(self, options, args)
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\commands\install.py", line 324, in run
2020-10-13T09:36:23,016 reqs, check_supported_wheels=not options.target_dir
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 183, in resolve
2020-10-13T09:36:23,016 discovered_reqs.extend(self._resolve_one(requirement_set, req))
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 388, in _resolve_one
2020-10-13T09:36:23,016 abstract_dist = self._get_abstract_dist_for(req_to_install)
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 340, in _get_abstract_dist_for
2020-10-13T09:36:23,016 abstract_dist = self.preparer.prepare_linked_requirement(req)
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\operations\prepare.py", line 469, in prepare_linked_requirement
2020-10-13T09:36:23,016 hashes=self._get_linked_req_hashes(req)
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\operations\prepare.py", line 239, in unpack_url
2020-10-13T09:36:23,016 unpack_vcs_link(link, location)
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\operations\prepare.py", line 99, in unpack_vcs_link
2020-10-13T09:36:23,016 vcs_backend.unpack(location, url=hide_url(link.url))
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\vcs\versioncontrol.py", line 733, in unpack
2020-10-13T09:36:23,016 self.obtain(location, url=url)
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\vcs\versioncontrol.py", line 641, in obtain
2020-10-13T09:36:23,016 self.fetch_new(dest, url, rev_options)
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\vcs\git.py", line 230, in fetch_new
2020-10-13T09:36:23,016 self.run_command(make_command('clone', '-q', url, dest))
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\vcs\versioncontrol.py", line 774, in run_command
2020-10-13T09:36:23,016 log_failed_cmd=log_failed_cmd)
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\vcs\versioncontrol.py", line 166, in call_subprocess
2020-10-13T09:36:23,016 raise SubProcessError(exc_msg)
2020-10-13T09:36:23,016 pip._internal.exceptions.SubProcessError: Command errored out with exit status 128: git clone -q 'ssh://****#github.com/<github_username>/<repo_name>.git' 'C:\Users\Alex\AppData\Local\Temp\pip-req-build-21n7avhs' Check the logs for full command output.
2020-10-13T09:36:23,032 Removed build tracker: 'C:\\Users\\Alex\\AppData\\Local\\Temp\\pip-req-tracker-6m9f9yue'
Hello I had this same exact problem!
I found the answer on:
https://docs.github.com/en/authentication/troubleshooting-ssh/error-permission-denied-publickey
It turns out that I needed to ensure that my ssh key was being used. I did so by following the directions on the github site which suggested that I run this command:
ssh -vT git#github.com
I ran this command prompt and It worked! I don't know how or why but it seems to have reset some sort of configuration to where my ssh shell now works. I'd tried all sorts of different solutions and was getting very discouraged about it because my linux setup worked fine! It was windows 10 that seemed to be giving me trouble.
After that I was able to pip install from github using the powershell inside of vscode (with a venv enabled).
I originally thought that the issue was my sshkey (that I'd pasted it wrong) but that wasn't the case. I also thought it might have been something with visual studio code but that wasn't the case either. Then I thought it might have been something with my security protocols. SO I tried enabling and disabling different ports through my firewall that were suggested in other forums and that didn't work either.
I knew something was up because whenever I created a key on my Desktop it would never show any activity of use when I viewed my keys on Github. But as soon as I ran the command a green light appeared and showed that it was recently activated. I have 2 ssh keys enabled (laptop and desktop) for my private repo and use it to pip install packages from there.
I hope this helps somebody out there! Sorry if I spoke too much. This is my first post. I just found this solution and had to share it because I was so excited!
I have a Python 2 package that I'm trying to upgrade to Python 3. It was written by someone who used to work on the same team I'm on now but who is no longer with the company, and unfortunately nobody left on the team is able to help out.
After running 2to3 on the files of the package, I ran python setup.py sdist to create a package, placed the package in a local repository, then attempted to use pip install to install the package. It ended up erroring out with the following:
Exception:
Traceback (most recent call last):
File "/home/user/project/lib/python3.5/site-packages/pip/basecommand.py", line 223, in main
status = self.run(options, args)
File "/home/user/project/lib/python3.5/site-packages/pip/commands/install.py", line 297, in run
root=options.root_path,
File "/home/user/project/lib/python3.5/site-packages/pip/req/req_set.py", line 622, in install
**kwargs
File "/home/user/project/lib/python3.5/site-packages/pip/req/req_install.py", line 808, in install
self.move_wheel_files(self.source_dir, root=root)
File "/home/user/project/lib/python3.5/site-packages/pip/req/req_install.py", line 1003, in move_wheel_files
isolated=self.isolated,
File "/home/user/project/lib/python3.5/site-packages/pip/wheel.py", line 340, in move_wheel_files
assert info_dir, "%s .dist-info directory not found" % req
AssertionError: my-package-name .dist-info directory not found
The old Python 2 version of the package didn't have anything called .dist-info in the .tgz archive, and it installed just fine. Does anyone know what's going on here and how to fix it?
In my case this was resolved by deleting AppData\Local\pip\Cache folder (windows). Should be fairly similar for other operating systems.
Django CMS 3.4.1
Django 1.10.2
pip modules: http://pastebin.com/vJWvZVfA
pip 8.1.2
Python 2.7.12
OS: Amazon Linux AMI release 2016.03
I'm new to Django CMS, Django, and Python. My previous CMS experience has been with WordPress and I'm try to try out Django CMS as an alternative to WordPress, but am getting an error that I can not seem to figure out. I have updated the pip modules and installed others as suggested in threads on StackOverflow, but to no avail.
I followed the tutorial the instructions, with the exception of the djangocms command, which is incorrect in the tutorial. (It's missing the -w flag.)
EDIT: As requested, here is the output with the --verbose flag added:
(env)[ec2-user#(redacted) tutorial-project]$ djangocms -d postgres://(redacted) -e no --permissions yes -l "en-CA, en-US, en, fr-CA, fr-FR" -p . --starting-page yes --verbose --utc mysite
Creating the project
Please wait while I install dependencies
Package install command: install django-cms<3.5 djangocms-admin-style>=1.2,<1.3 django-treebeard>=4.0,<5.0 psycopg2 djangocms-text-ckeditor>=3.2.1 djangocms-link>=1.8 djangocms-style>=1.7 djangocms-googlemap>=0.5 djangocms-snippet>=1.9 djangocms-video>=2.0 djangocms-column>=1.6 easy_thumbnails django-filer>=1.2 cmsplugin-filer>=1.1 Django<1.9 pytz django-classy-tags>=0.7 html5lib>=0.999999,<0.99999999 Pillow>=3.0 django-sekizai>=0.9 django-select2<5.0six
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-duWZSN/psycopg2/
The installation has failed.
*****************************************************************
Check documentation at https://djangocms-installer.readthedocs.io
*****************************************************************
Traceback (most recent call last):
File "/home/ec2-user/env/bin/djangocms", line 11, in <module>
sys.exit(execute())
File "/home/ec2-user/env/local/lib/python2.7/site-packages/djangocms_installer/main.py", line 33, in execute
verbose=config_data.verbose
File "/home/ec2-user/env/local/lib/python2.7/site-packages/djangocms_installer/install/__init__.py", line 91, in requirements
output = subprocess.check_output(['pip'] + args)
File "/usr/lib64/python2.7/subprocess.py", line 574, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '[u'pip', u'install', u'django-cms<3.5', u'djangocms-admin-style>=1.2,<1.3', u'django-treebeard>=4.0,<5.0', u'psycopg2', u'djangocms-text-ckeditor>=3.2.1', u'djangocms-link>=1.8', u'djangocms-style>=1.7', u'djangocms-googlemap>=0.5', u'djangocms-snippet>=1.9', u'djangocms-video>=2.0', u'djangocms-column>=1.6', u'easy_thumbnails', u'django-filer>=1.2', u'cmsplugin-filer>=1.1', u'Django<1.9', u'pytz', u'django-classy-tags>=0.7', u'html5lib>=0.999999,<0.99999999', u'Pillow>=3.0', u'django-sekizai>=0.9', u'django-select2<5.0six']' returned non-zero exit status 1
EDIT 2: (moved to answer)
EDIT 3:
After solving the first part, another error remains. I'll include it in this post since it still falls under the topic of the title:
Creating the project
Project creation command: /home/ec2-user/env/bin/python2.7 /home/ec2-user/env/bin/django-admin.py startproject mysite /home/ec2-user/tutorial-project
Database setup commands: /home/ec2-user/env/bin/python2.7 -W ignore manage.py migrate
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
utility.execute()
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 346, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 394, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute
output = self.handle(*args, **options)
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 93, in handle
executor = MigrationExecutor(connection, self.migration_progress_callback)
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 19, in __init__
self.loader = MigrationLoader(self.connection)
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 47, in __init__
self.build_graph()
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 191, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 59, in applied_migrations
self.ensure_schema()
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 49, in ensure_schema
if self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor()):
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 162, in cursor
cursor = self.make_debug_cursor(self._cursor())
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 135, in _cursor
self.ensure_connection()
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 130, in ensure_connection
self.connect()
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 118, in connect
conn_params = self.get_connection_params()
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 158, in get_connection_params
"settings.DATABASES is improperly configured. "
django.core.exceptions.ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the NAME value.
The installation has failed.
*****************************************************************
Check documentation at https://djangocms-installer.readthedocs.io
*****************************************************************
Traceback (most recent call last):
File "/home/ec2-user/env/bin/djangocms", line 11, in <module>
sys.exit(execute())
File "/home/ec2-user/env/local/lib/python2.7/site-packages/djangocms_installer/main.py", line 41, in execute
django.setup_database(config_data)
File "/home/ec2-user/env/local/lib/python2.7/site-packages/djangocms_installer/django/__init__.py", line 388, in setup_database
output = subprocess.check_output(command, env=env)
File "/usr/lib64/python2.7/subprocess.py", line 574, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['/home/ec2-user/env/bin/python2.7', u'-W', u'ignore', u'manage.py', u'migrate']' returned non-zero exit status 1
I'm going to guess that the problem lies in the message:
settings.DATABASES is improperly configured. Please supply the NAME value.
The installation has failed.
I'm using PostgreSQL, so I assume that the error is caused by the schema not being provided in the command argument. There was nothing in the guide that I saw indicating how to provide it, so I'll have to search some more.
The error message tells me absolutely nothing. It only tells me that Django tried to use pip to install something and for whatever reason it failed. In order to figure out what went wrong, try enabling verbose mode (python -v). If that gives the same output, or that isn't an option because you're using a program that calls Python (which it sounds like you are), let me know and prepare to go into the source code. Trust me, I have taken many a dive into source code for Python utilities, and as long as you don't do anything stupid (like delete a file) it's pretty hard to mess anything up. Even if you do you can always reinstall Django (or make a backup first). Don't worry about messing up your computer. You'd have to work hard to make Django do that!
Original error
The non-verbose error message indicates the error in a cryptic way, and using --verbose provides a more understandable message.
I was missing one required module (psycopg2) and four others were versions which were too new (easy_thumbnails, Django, html5lib, django-select2).
I uninstalled the four modules and then reinstalled them using the version requirement in the command. e.g. pip install 'Django<1.10'.
psycopg2 required extra steps, as I got an error message when trying to install it indicating that it could not find pg_config. Another SO answer advised that I just had to install postgresql-devel. After I did that, (sudo yum install postgresql-devel), I also uninstalled postgresql8-libs, as postgresql-devel came with a newer version. I didn't do it before since yum indicated a PHP dependency, and I wasn't sure if it would cause problems if I did.
Second error
Pretty simple. I was missing the /NAME component of the database URL (postgres://USER:PASSWORD#HOST:PORT/NAME).
Select a default region
1) us-east-1 : US East (N. Virginia)
2) us-west-1 : US West (N. California)
3) us-west-2 : US West (Oregon)
4) eu-west-1 : EU (Ireland)
5) eu-central-1 : EU (Frankfurt)
6) ap-southeast-1 : Asia Pacific (Singapore)
7) ap-southeast-2 : Asia Pacific (Sydney)
8) ap-northeast-1 : Asia Pacific (Tokyo)
9) ap-northeast-2 : Asia Pacific (Seoul)
10) sa-east-1 : South America (Sao Paulo)
11) cn-north-1 : China (Beijing)
(default is 3):5
When I choose a number or just leave it blank.. the following error appears:
ERROR: AttributeError :: 'NoneType' object has no attribute
'get_frozen_credentials'
after running eb init --debug:
Traceback (most recent call last): File "/usr/local/bin/eb", line 11,
in
sys.exit(main()) File "/Library/Python/2.7/site-packages/ebcli/core/ebcore.py", line 149, in
main
app.run() File "/Library/Python/2.7/site-packages/cement/core/foundation.py", line
694, in run
self.controller._dispatch()
File "/Library/Python/2.7/site-packages/cement/core/controller.py", line
455, in _dispatch
return func()
File "/Library/Python/2.7/site-packages/cement/core/controller.py", line
461, in _dispatch
return func()
File "/Library/Python/2.7/site-packages/ebcli/core/abstractcontroller.py",
line 57, in default
self.do_command()
File "/Library/Python/2.7/site-packages/ebcli/controllers/initialize.py",
line 67, in do_command
self.set_up_credentials()
File "/Library/Python/2.7/site-packages/ebcli/controllers/initialize.py",
line 152, in set_up_credentials
if not initializeops.credentials_are_valid():
File "/Library/Python/2.7/site-packages/ebcli/operations/initializeops.py",
line 24, in credentials_are_valid
elasticbeanstalk.get_available_solution_stacks()
File "/Library/Python/2.7/site-packages/ebcli/lib/elasticbeanstalk.py",
line 239, in get_available_solution_stacks
result = _make_api_call('list_available_solution_stacks')
File "/Library/Python/2.7/site-packages/ebcli/lib/elasticbeanstalk.py",
line 37, in _make_api_call
**operation_options)
File "/Library/Python/2.7/site-packages/ebcli/lib/aws.py", line 207, in make_api_call
response_data = operation(**operation_options)
File "/Library/Python/2.7/site-packages/botocore/client.py", line 310, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/Library/Python/2.7/site-packages/botocore/client.py", line 396, in _make_api_call
operation_model, request_dict)
File "/Library/Python/2.7/site-packages/botocore/endpoint.py", line 111, in make_request
return self._send_request(request_dict, operation_model)
File "/Library/Python/2.7/site-packages/botocore/endpoint.py", line 136, in _send_request
request = self.create_request(request_dict, operation_model)
File "/Library/Python/2.7/site-packages/botocore/endpoint.py", line 120, in create_request
operation_name=operation_model.name)
File "/Library/Python/2.7/site-packages/botocore/hooks.py", line 226, in emit
return self._emit(event_name, kwargs)
File "/Library/Python/2.7/site-packages/botocore/hooks.py", line 209, in _emit
response = handler(**kwargs)
File "/Library/Python/2.7/site-packages/botocore/signers.py", line 90, in handler
return self.sign(operation_name, request)
File "/Library/Python/2.7/site-packages/botocore/signers.py", line 123, in sign
signature_version)
File "/Library/Python/2.7/site-packages/botocore/signers.py", line 153, in get_auth_instance
kwargs['credentials'] = self._credentials.get_frozen_credentials()
AttributeError: 'NoneType' object has no attribute 'get_frozen_credentials'
You got this error because you didn't initialize your AWS Access Key ID and AWS Secret Access Key
you should install first awscli by runing pip install awscli.
After you need to configure aws:
aws configure
After this you can run eb init
Ran into this error as well. Not sure of the root cause. But am still on Yosemite. When I tried AWS's install script
curl -s https://s3.amazonaws.com/elasticbeanstalk-cli-resources/install-ebcli.py | python
It downloaded EB CLI 3.7.3 (Python 2.7.1). A co-worker tried on his machine using homebrew and (since he hadn't run brew update in awhile) managed to get version 3.5.4 which worked perfectly.
Looks like Amazon may have broken something in the updates for Yosemite users so rather than wait I just downloaded the working version and had no issues running eb init
Here's the steps I took:
Amazon created a symlink to version 3.7 in usr/local/bin called eb. Remove this link rm /usr/local/bin/eb
cd /usr/local/Library
Use homebrew's brew log awsebcli to find the sha for the updated commit of version 3.5.4 (21e20f5).
Run git checkout 21e20f5 /usr/local/Library/Formula/aws-elasticbeanstalk.rb
Run brew install awsebcli and eb init should now run properly.
Hope that helps!
Hey I facing the same problem, running eb for the first time on Arch Linux.
What worked for me was instead of simply using
eb init
try a parameterized init, for example for interactive init
eb init -i
Reference: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-init.html
Hope that helps :)
I had the same problem.
I installed aws-cli ( brew install awsebcli )
Next, run "aws configure" and provide the correct details.
This solved my problem.
Was also had same issue but solved it some how. As I was doing it for first time I prefer to follow step by step documentation but lead to above issue but solved by following simple steps
$ mkdir HelloWorld
$ cd HelloWorld
$ eb init -p PHP
$ echo "Hello World" > index.html
$ eb create dev-env
$ eb open
In my case while following document steps I never asked for id/secret but with above commands it was possible.
Hope it work for you!
With credentials stored in ~/.aws/credentials and even after calling aws configure, I still had to use --profile profile_name with the command that was failing with the "no attribute 'get_frozen_credentials'" error. This fixed it for me.
I had the same problem but none of the above helped me. My problem was solved after creating an IAM user http://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html and generating new keys for it instead of using root and root keys and doing things the legacy way.
I have python 2.7 installed on my linux box, and I'm trying to schedule a python script via crontab. The script works fine from the command line, however when running via cron I get:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site.py", line 553, in <module>
main()
File "/usr/local/lib/python2.7/site.py", line 535, in main
known_paths = addusersitepackages(known_paths)
File "/usr/local/lib/python2.7/site.py", line 268, in addusersitepackages
user_site = getusersitepackages()
File "/usr/local/lib/python2.7/site.py", line 243, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/local/lib/python2.7/site.py", line 233, in getuserbase
USER_BASE = get_config_var('userbase')
File "/usr/local/lib/python2.7/sysconfig.py", line 535, in get_config_var
return get_config_vars().get(name)
File "/usr/local/lib/python2.7/sysconfig.py", line 434, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/usr/local/lib/python2.7/sysconfig.py", line 298, in _init_posix
raise IOError(msg)
IOError: invalid Python installation: unable to open /usr/include/python2.7/pyconfig.h (No such file or directory)
I see that /usr/include/python2.7 does't exist, but /usr/local/include/python2.7/ does. Did I make a mistake while installing python?
You probably just have 2 versions installed, one of which is broken. If your cron is just directly calling python instead of a specific path, your PATH probably contains /usr/bin before /usr/local/bin (which is typical) - so in your cron, specify which python to use, or remove the existing one in /usr/bin and symlink /path/to/good/python to /usr/bin/python.
Edit: scratch that, just re-read and saw that it works fine from the command line. python-dev is probably the way to go. Sorry!
You need python2.7-dev, which installs the includes and headers.
For Ubuntu, you run sudo apt-get install python2.7-dev to install it. What Linux distro are you running?
I am assuming that in your crontab file, you are giving the full path to the python executable, and not just relying on she-bang with executable permissions. If not, please give point to the full-path python2.7 in the crontab file and also use the same full-path on the command line to ensure that you don't get this problem.If you get this on command line too, then it is probably missing some development headers. (Are you trying to compile something like using setup.py build and trying to do it via crontab?) I am trying to understand where would one need those headers. So, apart from the above suggestion, extra information from your end might ofcourse help further.