What is the default install path for poetry - python

I installed poetry, however I'm getting the following error when attempting to call poetry
zsh: command not found: poetry
I know I have it installed because I get the following output when trying to run the following install script
$ curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
Retrieving Poetry metadata
Latest version already installed.

The default install location is ~/.poetry/bin/poetry
I added the following to my .zshrc
export PATH=$PATH:$HOME/.poetry/bin

Initially I wanted to run poetry within a condo environment. After running
pip install poetry
I saw it was installed using my local Python and not linked to a conda environment. In my case I added
export PATH="$HOME/.local/bin:$PATH"
to the end of the .zshrc file under my home directory.
Tip: You can use CMD+Shift+. for MacOS to view your hidden files and folders :)

Update for the new version of the official poetry installer:
curl -sSL https://install.python-poetry.org | python3 -
This version will install in your default python3 bin. For example: $HOME/Library/Python/3.9/bin, the installer will print out the location to your shell.
Add
export PATH=$HOME/Library/Python/3.9/bin:$PATH
to ~/.profile or ~/.zprofile.

Related

Python not recognizing virtualenv

First I run command pip install virtualenv then after I run python -m virtualenv venv, I get this following error msg
"/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: No module named virtualenv"
Cuurently, I'm using python v2.7.16 and when I run pip freeze | grep virtualenv , I get virtualenv==20.4.2 so virtualenv is there. When I run which python I get /usr/bin/python and I don't have .bash_profile when I run ls -a. I am using mac. What could be the reasons python not recognizing virtualenv when it's there?
You may create .bash_profile and it is auto-recognised by the macintosh machine.
Please also run which pip and make sure the pip is in the same bin as your python (/usr/bin/python)
The bottom line is pip used to install a package by default will install the packages in the bin directory that also stored your python executable.

Getting command not found: rasa on using rasa commands

I have installed rasa using:
pip3 install rasa
When I try to use rasa commands like:
rasa init
I get zsh errors:
command not found: rasa error
I am on Mac OS Catalina, using:
Python version 2.7.16
Python3 version 3.7.6
pip version 19.2.3
My path variable looks like this:
/Library/Frameworks/Python.framework/Versions/3.7/bin
:/usr/local/bin
:/usr/bin
:/bin
:/usr/sbin
:/sbin
RASA is currently incompatible with python 3.9+
I'm having python 3.10, and have to switch to python 3.8 for working with Rasa.
To save yourself time:
1. Install python 3.8
2. Create and activate virtual environment:
py -3.8 -m pip install virtualenv
py -3.8 -m virtualenv venv
venv\Scripts\activate
3. Upgrade pip
py -3.8 -m pip install -U pip
4. Install Rasa
pip install rasa
5. Check installation
rasa -h
You should see something like:
usage: rasa [-h] [--version] {init,run,shell,train,interactive,telemetry,test,visualize,data,export,x,evaluate} ...
Rasa command line interface. Rasa allows you to build your own conversational assistants 🤖. The 'rasa' command allows
you to easily run most common commands like creating a new bot, training or evaluating models.
...
I also got the similar error in ubuntu, you can try these set of command:
pip install -U pip
pip install rasa
The first command will update the python package manager and the second will install rasa.
If pip install rasa is not working, then you can try pip3 install rasa
I had followed these following steps and it's working fine for me
Firstly, create a directory name of your choice and get inside of it
mkdir rasaprojects #directory name of your choice in place of rasaprojects
cd rasaprojects #get inside that directory
Now create virtual environment of python3
virtualenv rasaenv -p python3 #write your environment name instead of rasaenv
Now activate the environment
source rasaenv/bin/activate
Finally you are good to go with rasa installation
pip3 install rasa
I add ~/.local/bin to my $PATH in .bashrc, and It resolved the problem:
Go to the home directory:
cd
Find your file location (for me it was ./.bashrc):
sudo find -name .bashrc
Open .bashrc by nano:
nano ./.bashrc
Add next code at the end of the file:
export PATH="$HOME/.local/bin:$PATH"
Restart your shell.
You should activate your python env, create a folder with mkdir and then open it with cd and then: rasa init --no-prompt (ubuntu user)
I solved this problem by downgrading python specifically 3.6.8. However, you can install any version from Python 3.6.x to 3.8.x, and NOT 3.9.
Tips: Don't add variable paths while installing multiple versions of python.
In my case, I had 3.9 python and didn't want to uninstall it because I was a working project on the 3.9 version. If you have the same case, then follow the steps. Otherwise, you can alter step2 : python -m venv project_name\venv
Step 1: Install python from above given ranges. Again, please don't install python 3.9 because it is not currently compatible.
Step 2: Delete the existing virtual environment, if you have already created it while priviously installing the rasa. Make new one
> C:\Users\name\AppData\Local\Programs\Python\Python36\python -m venv project_name\venv
(venv: name of the virtual environment)
This command allows creating a new virtual environment with python just you installed it through step1. You can check python -m version
Step 3: Activate the environment
> project_name\venv\Scripts\acitvate.bat
Step 4: Finally, start installing the rasa:
> pip install rasa
Step 5:
> rasa init
Note: I wasn't using anaconda. If you are currently using an anaconda environment, please do needful with the above steps.
If you still cannot resolve it, please follow thread or you can post there your specific query.
other way to do it using docker so will be no issues.
1.make new directory example rasadocker and open terminal or command prompt
2.run following command docker run --user 1000 -v $(pwd):/app rasa/rasa:3.1.0-full init --no-prompt here --user 1000 for no error of user permission ,-v is for volume, pwd is current directory, :/app is volume in docker image , rasa/rasa is rasa docker image with tag 3.1.0-full ,important thing here to create a project we use init
3.you can see in current folder project required files are added
4.to play with bot run following command `
docker run --user 1000 -it -v $(pwd):/app rasa/rasa:3.1.0-full shell opens shell where bot asks you input
`

Pipenv: Command Not Found

I'm attempting to use pipenv. I ran the command pip install pipenv, which ran successfully:
...
Successfully built pipenv pathlib shutilwhich pythonz-bd virtualenv-clone
Installing collected packages: virtualenv, pathlib, shutilwhich, backports.shutil-get-terminal-size, pythonz-bd, virtualenv-clone, pew, first, six, click, pip-tools, certifi, chardet, idna, urllib3, requests, pipenv
...
However, when I run the command pipenv install in a fresh root project directory I receive the following message: -bash: pipenv: command not found. I suspect that I might need to modify my .bashrc, but I'm unclear about what to add to the file or if modification is even necessary.
This fixed it for me:
sudo -H pip install -U pipenv
That happens because you are not installing it globally (system wide). For it to be available in your path you need to install it using sudo, like this:
$ sudo pip install pipenv
If you've done a user installation, you'll need to add the right folder to your PATH variable.
PYTHON_BIN_PATH="$(python3 -m site --user-base)/bin"
PATH="$PATH:$PYTHON_BIN_PATH"
See pipenv's installation instructions
I tried this:
python -m pipenv # for python2
python3 -m pipenv # for python3
Why this works: In Bash and other Unix-like shell environments, the -m option is used to specify a module to be run as a script.
When you run a Python script using the python -m command, you are telling the Python interpreter to execute the script as if it were a top-level module, rather than as a script file. The python -m pipenv command tells the Python interpreter to run the pipenv module as a script. The pipenv module must be importable from the current working directory or from one of the directories in the PYTHONPATH environment variable.
I have same problem with pipenv on Mac OS X 10.13 High Seirra, another Mac works just fine. I use Heroku to deploy my Django servers, some in 2.7 and some in 3.6. So, I need both 2.7 and 3.6. When HomeBrew install Python, it keeps python points to original 2.7, and python3 points to 3.6.
The problem might due to $ pip install pipenv. I checked /usr/local/bin and pipenv isn't there. So, I tried a full uninstall:
$ pip uninstall pipenv
Cannot uninstall requirement pipenv, not installed
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
$ pip3 uninstall pipenv
Skipping pipenv as it is not installed.
Then reinstall and works now:
$ pip3 install pipenv
Collecting pipenv
Where Python store packages
Before jumping into the command that will install pipenv, it is worth understanding where pip installs Python packages.
Global site-packages is where Python installs packages that will be available to all users and all Python applications on the system. You can check the global site package with the command
python -m site
For example, on Linux with Python 3.7 the path is usually
/usr/lib/python3.7/dist-packages/setuptools
User site-packages is where Python installs packages available only for you. But the packages will still be visible to all Python projects that you create. You can get the path with
python -m site --user-base
On Linux with Python 3.7 the path is usually
~/.local/lib/python3.7/site-packages
Using Python 3.x
On most Linux and other Unices, usually Python 2 and Python 3 is installed side-by-side. The default Python 3 executable is almost always python3. pip may be available as either of the following, depending on your Linux distribution
pip3
python3-pip
python36-pip
python3.6-pip
Linux
Avoid using pip with sudo! Yes, it's the most convenient way to install Python packages and the executable is available at /usr/local/bin/pipenv, but it also mean that specific package is always visible for all users, and all Python projects that you create. Instead, use per-user site packages instead with --user
pip3 install --user pipenv
pipenv is available at
~/.local/bin/pipenv
macOS
On macOS, Homebrew is the recommended way to install Python. You can easily upgrade Python, install multiple versions of Python and switch between versions using Homebrew.
If you are using Homebrew'ed Python, pip install --user is disabled. The global site-package is located at
/usr/local/lib/python3.y/site-packages
and you can safely install Python packages here. Python 3.y also searches for modules in:
/Library/Python/3.y/site-packages
~/Library/Python/3.y/lib/python/site-packages
Windows
For legacy reasons, Python is installed in C:\Python37. The Python executable is usually named py.exe, and you can run pip with py -m pip.
Global site packages is installed in
C:\Python37\lib\site-packages
Since you don't usually share your Windows devices, it is also OK to install a package globally
py -m pip install pipenv
pipenv is now available at
C:\Python37\Scripts\pipenv.exe
I don't recommend install Python packages in Windows with --user, because the default user site-package directory is in your Windows roaming profile
C:\Users\user\AppData\Roaming\Python\Python37\site-packages
The roaming profile is used in Terminal Services (Remote Desktop, Citrix, etc) and when you log on / off in a corporate environment. Slow login, logoff and reboot in Windows can be caused by a large roaming profile.
OSX GUYS, OVER HERE!!!
As #charlax answered (for me the best one), you can use a more dynamic command to set PATH, buuut for mac users this could not work, sometimes your USER_BASE path got from site is wrong, so you need to find out where your python installation is.
$ which python3
/usr/local/bin/python3.6
you'll get a symlink, then you need to find the source's symlink.
$ ls -la /usr/local/bin/python3.6
lrwxr-xr-x 1 root wheel 71 Mar 14 17:56 /usr/local/bin/python3.6 -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6
(this ../../../ means root)
So you found the python path (/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6), then you just need to put in you ~/.bashrc as follows:
export PATH="$PATH:/Library/Frameworks/Python.framework/Versions/3.6/bin"
Installing pipenv globally can have an adverse effect by overwriting the global/system-managed pip installation, thus resulting in import errors when trying to run pip.
You can install pipenv at the user level:
pip install --user pipenv
This should install pipenv at a user-level in /home/username/.local so that it does not conflict with the global version of pip. In my case, that still did not work after running the '--user' switch, so I ran the longer 'fix what I screwed up' command once to restore the system managed environment:
sudo python3 -m pip uninstall pip && sudo apt install python3-pip --reinstall
^ found here: Error after upgrading pip: cannot import name 'main'
and then did the following:
mkdir /home/username/.local ... if it doesn't already exist
export PYTHONUSERBASE=/home/username/.local
Make sure the export took effect (bit me once during this process):
echo $PYTHONUSERBASE
Then, I ran the pip install --user pipenv and all was well. I could then run pipenv from the CLI and it did not overwrite the global/system-managed pip module. Of course, this is specific to the user so you want to make sure you install pipenv this way while working as the user you wish to use pipenv.
References:
https://pipenv.readthedocs.io/en/latest/diagnose/#no-module-named-module-name https://pipenv.readthedocs.io/en/latest/install/#pragmatic-installation-of-pipenv https://pip.pypa.io/en/stable/user_guide/#user-installs
I don't know what happened, but the following did the work (under mac os catalina)
$ brew install pipenv
$ brew update pipenv
after doing this i am able to use
$ pipenv install [package_name]
OS : Linux
Pip version : pip3
sudo -H pip3 install -U pipenv
OS : Windows
Pip version : any one
sudo -H pip install -U pipenv
For thse who installed it using sudo pip3 install pipenv, you need to use python3 -m pipenv shell or python3.9 -m pipenv shell
I'm using zsh on my Mac, what worked for me is at first install pipenv
pip3 install --user pipenv
Then I changed the PATH in the ~/.zshrc
vi ~/.zshrc
In the editor press i to insert your text:
export PATH="/Users/yourUser/Library/Python/3.9/bin:$PATH"
Press esc and then write :wq!
Close the terminal and re-open it.
And finally write pipenv
This way worked for me using macOS BigSur 11.1
On Mac you may have to do:
pip3 install pipenv
Then, cd into your root directory to locate the .zshrc file.
Then add this to path
export PATH=/Library/Frameworks/Python.framework/Versions/3.9/bin:$PATH
Note: 3.9 is the version of Python running on your system.
Note: You can access the .zshrc by using cmd + shift + .
in your root directory... the file is hidden by default
Save and restart your terminal
Fixed this easily by installing pipenv with my central package manager (apt)
sudo apt install pipenv
You could easily install pipenv using your package manager (apt, yum, brew) and it adds it directly to your $PATH variables.
More to mention is it works on zsh. I use zsh on Ubuntu and tried adding pipenv to $PATH and other solutions but didn't work till I used apt to install it.
HOW TO MAKE PIPENV A BASIC COMMAND
Pipenv with Python3 needs to be run as "$ python -m pipenv [command]" or "$ python3 -m pipenv [command]"; the "python" command at the beginning varies based on how you activate Python in your shell. To fix and set to "$ pipenv [command]": [example in Git Bash]
$ cd ~
$ code .bash_profile
The first line is necessary as it allows you to access the .bash_profile file. The second line opens .bash_profile in VSCode, so insert your default code editor's command.
At this point you'll want to (in .bash_profile) edit the file, adding this line of code:
alias pipenv='python -m pipenv'
Then save the file and into Git Bash, enter:
$ source .bash_profile
You can then use pipenv as a command anywhere, for example:
$ pipenv shell
Will work.
This method of usage will work for creating commands in Git Bash. For example:
alias python='winpty python.exe'
entered into the .bash_profile and:
$ source .bash_profile
will allow Python to be run as "python".
You're welcome.
On Mac OS X Catalina it appears to follow the Linux path. Using any of:
pip install pipenv
pip3 install pipenv
sudo pip install pipenv
sudo pip3 install pipenv
Essentially installs pipenv here:
/Users/mike/Library/Python/3.7/lib/python/site-packages/pipenv
But its not the executable and so is never found. The only thing that worked for me was
pip install --user pipenv
This seems to result in an __init__.py file in the above directory that has contents to correctly expose the pipenv command.
and everything started working, when all other posted and commented suggestions on this question failed.
The pipenv package certainly seems quite picky.
If you are on MAC
sudo -H pip3 install pipenv
For window users this may be due to conflicting installation with virtualenv. For me it worked when I uninstalled virtualenv and pipenv first, and then install only pipenv.
pip uninstall virtualenv
pip uninstall pipenv
pip install pipenv
Now pipenv install xxx worked for me
After installing pipenv (sudo pip install pipenv), I kept getting the "Command Not Found" error when attempting to run the pipenv shell command.
I finally fixed it with the following code:
pip3 install pipenv
pipenv shell
Here is how I successfully resolved "Pipenv: Command Not Found" on my Mac OSX
You should change the ownership of these directories to your user.
sudo chown -R $(whoami) /usr/local/share
make sure that your user has write permission.
chmod u+w /usr/local/share
Then Consider installing with Homebrew:
brew update
brew install pyenv
This simply solved it for me if you are on windows.
pip install pipenv
Second, replace your <username> in the following paths and add them to the PATH environment variable:
c:\Users\<username>\AppData\Roaming\Python\Python38\Site-Packages
C:\Users\<username>\AppData\Roaming\Python\Python38\Scripts
You need to close the Command Prompt and reopen it.
Third, type the following command to check if the pipenv installed correctly:
pipenv -h
I hope this helps you too!
In this case you just need to add the binary path to your bash. In case you're using ZSH for example you need to edit the.zshrc file as an admind and then add the code mentioned by #charlax on the comments above:
PYTHON_BIN_PATH="$(python3 -m site --user-base)/bin"
PATH="$PATH:$PYTHON_BIN_PATH"
You might consider installing pipenv via pipsi.
curl https://raw.githubusercontent.com/mitsuhiko/pipsi/master/get -pipsi.py | python3
pipsi install pew
pipsi install pipenv
Unfortunately there are some issues with macOS + python3 at the time of writing, see 1, 2. In my case I had to change the bashprompt to #!/Users/einselbst/.local/venvs/pipsi/bin/python
In some cases of old pip version:
sudo easy_install pip
sudo pip install pipenv
First check if pipenv is installed:
pipenv --version
If no version is available on your system, then run the following command to install pipenv
sudo aptitude install pipenv
first install pip using following command
pip3 install pipenv
Now check whether pipenv is showing by using following command
pipenv --version if you see like command not found: pipenv use following commands
Now we have to set the path for pipenv, to do that first we have to find the user base binary directory,
On linux and Mac we can do it as following
python3 -m site --user-base
this command will display something like this
/some_directory/Python/3.9
use the path displayed in your terminal and append /bin at the end, now your path looks like this
/some_directory/Python/3.9/bin
now you have to set the path, if you are using zsh (z shell) type nano ~/.zshrc in the terminal or if you are using code editor like VSCode and path is set for VScode type code ~/.zshrc
if you are using bash use nano ~/.bashrc or code ~/.bashrc
in the file at last add following line
export PATH="$PATH:/somedirectory/Python/3.9/bin"
save the file and exit the terminal
now open new terminal and type pipenv --version you should see something like pipenv, version 2022.10.25
on Windows we can do as following
python -m site --user-site
you should see something like
C:\Users\Username\AppData\Roaming\Python36\site-packages`
now replace site-packages with Scripts.
this could return
C:\Users\Username\AppData\Roaming\Python36\Scripts
You can set your user PATH permanently in the Control Panel. You may need to log out for the PATH changes to take effect.
It's probably installed in your user path.
for instance, if your user(username) is tom check this path
/home/tom/.local/bin/pipenv
if pipenv exists in the path you can move or copy it to the general user path, so you can execute pipenv from all terminal sessions.
cp /home/tom/.local/bin/pipenv /usr/bin/
then you should be able to run pipenv
For me, what worked on Windows was running Command Prompt as administrator and then installing pipenv globally: python -m pip install pipenv.

Why can't I find ansible when I install it using setup.py?

Because I had some trouble with Ansible (I'm on mac) which seemed to be fixed in the latest dev version today I uninstalled ansible through pip (sudo pip uninstall ansible) and reinstalled the latest dev version from the github repo using the classic setup.py method, which seemed to end successfully (full output here.
So then I tried using it:
$ ansible --version
-bash: ansible: command not found
$ which ansible
$
I checked where it is installed. From the full output I linked to above I found that it is installed in /usr/local/lib/python2.7/site-packages, and indeed in there I find an egg:
$ ls -l /usr/local/lib/python2.7/site-packages | grep ansible
drwxr-xr-x 4 root admin 136 Aug 22 16:33 ansible-2.4.0-py2.7.egg
When I start Python and check the site-packages folder I find a different folder:
>>> import site; print site.getsitepackages()[0]
/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
but that is a symlink to the same folder:
$ ls -l /usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
lrwxr-xr-x 1 hielke admin 54 Aug 13 22:36 /usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages -> ../../../../../../../../../lib/python2.7/site-packages
So I guess the problem is that no symlink is created to the ansible package in /usr/local/bin/. But I'm unsure how I could create such a symlink and why it wouldn't appear in the first place.
Does anybody know how I can move forward from here? All tips are welcome!
When you invoke ansible from the shell, bash will search in your $PATH for a file named ansible that is executable. This may not be the only issue, but this is the immediate cause for the error you're seeing. The .egg file itself is not an executable, it's just a file used for distributing the code.
If ansible has been installed correctly, you should be able to find it by using locate or the OSX Finder GUI. The name should match exactly, with no file extensions. You will probably also find ansible-connection, ansible-console, etc. in the same place where you find the ansible executable. If you find it, great! Test it out and add that directory to your $PATH in a terminal like so:
export PATH=$PATH:/path/to/ansible
Where /path/to/ansible is the directory where you found the executables. This change to the $PATH variable is temporary, and will go away when you close your shell. If you can now run ansible from bash, then you can make the change permanent by adding that export to the end of your $HOME/.bash_profile file, or by adding a rule in /etc/paths.d (recommended by Apple). See more on how exactly to do those here if you are unfamiliar with them.
Now, if that's not the problem and you can't find the ansible executable, then the installation itself is your problem. You might also try using a virtual environment (if you have it installed) to make sure that the version you're pulling from github isn't broken:
git clone https://github.com/ansible/ansible.git
cd ansible
virtualenv venv
source venv/bin/activate
pip install .
which ansible
As of this writing, the above gives me a working ansible install.
For those using the Windows 10 Ubuntu terminal, running this command should fix the issue:
export PATH=$PATH:~/.local/bin
Find where ansible reside on your Mac. Most times its /Users/<yourusername>/Library/Python/3.7/bin
or /Users/<yourusername>/Library/Python/2.7/bin. Then ...
export PATH=$PATH:/Users/<yourusername>/Library/Python/3.7/bin
You can store this in your .bashrc file.
Well, I think you just need to create a soft link
ln -s /Users/${yourname}/Library/Python/${python version}/bin/ansible /usr/local/bin/ansible
pip3 install ansible --user
this installs in ~/.local. just include this in PATH, it will work
example: export PATH="$PATH:~/.local/bin"
I faced same issue when I installed ansible. Run the below commands to solve the issue. But we have to active each time when we open a bash session if we want to use ansible.
$ python -m virtualenv ansible
$ source ansible/bin/activate
$ pip install ansible
I'm using zsh so in my /Users/arojas/.zshrc I add this line that's where my Ansible got installed by Python
export PATH="$PATH:$HOME/Library/Python/3.7/bin"
I faced the same issue and after have installed it used pip3 install ansible it all works now.
I suggest uninstalling Ansible and re-installing it using pip according to the method suggested in the Ansible docs:
Or if you are looking for the latest development version:
pip install git+https://github.com/ansible/ansible.git#devel
If you are installing on OS X Mavericks, you may encounter some noise from your compiler. A workaround is to do the following:
$ sudo CFLAGS=-Qunused-arguments CPPFLAGS=-Qunused-arguments pip install ansible
Readers that use virtualenv can also install Ansible under virtualenv, though we’d recommend to not worry about it and just install Ansible globally. Do not use easy_install to install ansible directly.
system/instance used: ec2 RH8, as root
# pip3 install ansible (not recommended - should be by a user)
# ansible --version ( not found - wtf?!)
# yum install mlocate
# update
# locate ansible (long output; scroll to where you input command)
# export PATH=$PATH:/usr/local/bin
# ansible --version (success, Yes!)
system/instance used: ec2 RH8, as root
# pip3 install ansible (not recommended - should be by a user)
# ansible --version ( not found - :( )
# yum install mlocate
# updatedb (updatedb creates or updates a database used by locate)
# locate ansible (TL;DR)
# export PATH=$PATH:/usr/local/bin (Add this line to .bashrc)
# source .bashrc (To reflect the changes in the bash)
# ansible --version (success, Yes!)

installing a python package in a virtual environment

I started a virtual environment and installed egcurl from https://github.com/akamai-open/edgegrid-curl like this:
virtualenv venv
source venv/bin/activate
pip install httpie-edgegrid
However, when I try to run it like this:
egcurl -X POST -uadmin:admin SOME_URL
I get:
-bash: ./egcurl: No such file or directory
What could be the cause of this?
The installation instructions are quite poor, and don't make it clear that the egcurl script needs to be installed separately. To get it working properly, follow these steps:
$ virtualenv venv
$ source venv/bin/activate
$ pip install edgegrid-python
$ curl https://raw.githubusercontent.com/akamai-open/edgegrid-curl/master/egcurl > venv/bin/egcurl
$ chmod +x venv/bin/egcurl
$ egcurl --help
Note that httpie-edgegrid is a different utility which doesn't use the egcurl script at all. If you want to know how to use it, take a look at this README.
Check the following:
which egcurl
This will probably tell you it is trying to execute egcurl in the directory you are currently in and report something like "./egcurl."
You can either cd into the folder that contains egcurl which, if you are using virtualenv, should be in workspace/lib/... Then run your script.
If you have trouble finding egcurl do the following:
find / -name "egcurl"
Then you can setup an alias to the absolute path or add it to the virtualenv activate script.
You can also use the following command:
pip show httpie-edgegrid
This will show you useful information, like where the package is installed. Example:
(venv) bruno#bbc-host:~/venv$ pip show httpie-edgegrid
---
Metadata-Version: 2.0
Name: httpie-edgegrid
Version: 1.0.4
Summary: Edgegrid plugin for HTTPie.
Home-page: https://github.com/akamai-open/httpie-edgegrid
Author: Kirsten Hunter
Author-email: khunter#akamai.com
Installer: pip
License: Apache 2.0
Location: /home/bruno/venv/lib/python2.7/site-packages
Requires: httpie, pyOpenSSL, edgegrid-python
Classifiers:
Entry-points:
[httpie.plugins.auth.v1]
httpie_oauth1 = httpie_edgegrid:EdgeGridPlugin
Make sure the package is installed in your venv and not in a global directory.
Although I think solarc is right, this package is probably not the one that allows you to use egcurl. You are installing this one: https://github.com/akamai-open/httpie-edgegrid

Categories