$ python3 setup.py install
running install
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 2] No such file or directory: '/Library/Python/3.7/site-packages/test-easy-install-3544.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/Library/Python/3.7/site-packages/
This directory does not currently exist. Please create it and try again, or
choose a different installation directory (using the -d or --install-dir
option).
When I use command which python3, I got the Path: /usr/local/bin/python3
What should I do?
Related
Has anyone encountered this error before with vcpkg? I'm running MacOS. To install vcpkg I ran:
git clone https://github.com/Microsoft/vcpkg
...
./bootstrap-vcpkg.sh
...
./vcpkg integrate install
zsh: permission denied: ./vcpkg
Also trying to run:
./vcpkg install wxwidgets
zsh: permission denied: ./vcpkg
Yep, it needs to be executed from the /bin directory and not from the /vcpkg directory. so that means (if you used brew to install it, otherwise it'll be somewhere else) ⤵︎
$ cd /usr/local/Cellar/vcpkg/2020.11-1/bin
(just open a file explorer window and find the bin folder in vcpkg, you can then copy the path name and use that for your cd command, or open a shell window at that directory)
Then all you have to do is simply run the original command ⤵︎
$ ./vcpkg integrate install
For context, I'm trying to point pip at the directory that PyCharm is using. Running OSX High Sierra. Google hasn't had any answers yet (As far as I can tell).
In the command line, if I enter
pip install SpeechRecognition -t /Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4/site-packages
It gives me
OSError: [Errno 20] Not a directory
If I try
pip install SpeechRecognition -t /Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4/
I get
ERROR: Target path exists but is not a directory, will not continue.
I tried updating pip, and still no luck. What should I try next?
The target dir you're trying to specify is incorrect - it should be
/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages
(lib dir instead of bin that stores the executables).
However, it looks like you are trying to install into the python dist's default site packages dir - you shouldn't need to explicitly specify the target dir in this case. Instead, use the correct pip executable:
$ pip3.4 install SpeechRecognition
If pip3.4 executable is not available, use the one bundled with Python 3.4:
$ python3.4 -m pip install SpeechRecognition
I want to compile python3 from source so I followed the instructions.
However, during the make command I get the error
./Modules/zlibmodule.c:10:18: fatal error: zlib.h: No such file or directory
How do I solve this without having to install zlib as I do not have root access. Is there a way to skip this file while compilation?
You can try and use python-dev instead, it includes header files, a static library and development tools for building Python modules, extending the Python interpreter or embedding Python in applications. To install this package, enter:
For Python version 3.x+
$ sudo apt-get install python3-dev
I am trying to use postgresql in my Django project so I have been trying to install psycopg2 however I keep running into problems. Since I am using a virtualenv, installing psycopg2 through macports isn't helping. I need to find someway to install it as an app within my virtual env.
Here is the error I get when I try to pip install it in my virtualenv:
Downloading/unpacking psycopg2
Downloading psycopg2-2.5.4.tar.gz (682kB): 682kB downloaded
Running setup.py (path:/Users/adfelix2/Documents/Hindsait_Work/Projects/nybc_pilot/build/psycopg2/setup.py) egg_info for package psycopg2
Error: pg_config executable not found.
Please add the directory containing pg_config to the PATH
or specify the full executable path with the option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/psycopg2.egg-info
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
Error: pg_config executable not found.
Please add the directory containing pg_config to the PATH
or specify the full executable path with the option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /Users/user/'privateinfo'/my_virtualenv/build/psycopg2
Storing debug log for failure in /Users/user/.pip/pip.log
Seems like I need to add a directory to pg_config? However I am unable to come across anything online that would help me do so. If anybody has an answer to this, in a step-by-step manner, it would be very gladly appreciated. Thank you.
If you run error like this then you need install two packages.
sudo apt-get install libpq-dev python-dev
now install psycopg2
pip install psycopg2
If you have installed the Postgres.app, the one that sits in the Mac's menu bar, you will have to point your path at the pg_config executable in the App's bundle. You can navigate to the executable by visiting
/Applications/Postgres.app/Contents/Versions/9.3/bin
where your version would depend on what you have installed. Add this to to your $PATH variable in your .bash_profile, reload it, and voila!
pg_config should located in
/Library/PostgreSQL/9.3/bin/pg_config
(substitute what ever version of Postgres you have installed for the 9.3)
Just add that directory to your PATH environment variable and you should be able to move forward.
Run this in your terminal to get the location of the pg_config executable
which pg_config
Depending on how you installed postgres, you should get a path similar to either of these
/Library/PostgreSQL/9.3/bin/pg_config
or
/usr/local/bin/pg_config
Add the directory holding the pg_config executable to your PATH environment variable like this
export PATH="/Library/PostgreSQL/9.3/bin:$PATH"
or
export PATH="/usr/local/bin:$PATH"
If the command which pg_config returns nothing, then you should install postgres first by running
brew install postgres
Then repeat the steps listed above.
I'd like to install PECL Zip extension for my local web server but I'm getting an annoying error:
Lenny-MacBook-Pro:Downloads lenny$ pecl install zip-1.12.4.tgz
96 source files, building
WARNING: php_bin /Applications/MAMP/bin/php/php5.5.3/bin/php appears to have a suffix /php5.5.3/bin/php, but config variable php_suffix does not match
running: phpize
grep: /Applications/MAMP/bin/php/php5.5.3/include/php/main/php.h: No such file or directory
grep: /Applications/MAMP/bin/php/php5.5.3/include/php/Zend/zend_modules.h: No such file or directory
grep: /Applications/MAMP/bin/php/php5.5.3/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.
ERROR: `phpize' failed
What do I have to install to make this work?
Thanks in advance