I have installed python3.6 in my desktop which already had python3.5 and python2.7 inside. I change the default path for both python and python3 to python3.6 but it seems like python-config is still on python2.7 and python3-config is still on python3.5. How can I change the default python3-config or python-config to python3.6-config?
Thanks for the help!
so to elaborate on my comment, python comes usually with a version attached like so
ls -lisa /usr/local/bin/ | grep python
34138948 16 -r-xr-xr-x 2 root wheel 5248 15 Apr. 03:12 python3.7
34138954 0 lrwxr-xr-x 1 root wheel 17 15 Apr. 03:12 python3.7-config -> python3.7m-config
34138948 16 -r-xr-xr-x 2 root wheel 5248 15 Apr. 03:12 python3.7m
34138949 8 -r-xr-xr-x 1 root wheel 2936 15 Apr. 03:12 python3.7m-config
34127071 16 -r-xr-xr-x 1 root wheel 5216 15 Apr. 10:59 python3.9
34127072 8 -r-xr-xr-x 1 root wheel 3153 15 Apr. 10:59 python3.9-config
as you can see some names are already symlinks (the once with the -> ) so if you wanna access python3.9-config as python3-config you need to make a symlink with the name python3-config that points to the binary python3.9-config.
% sudo ln -s /usr/local/bin/python3.9-config /usr/local/bin/python3-config
so which should now give you
% which python3-config
/usr/local/bin/python3-config
looking at the directory again shows the symlink now
% ls -lisa /usr/local/bin | grep python3
34127092 0 lrwxr-xr-x 1 root wheel 31 22 Juni 14:09 python3-config -> /usr/local/bin/python3.9-config
34138948 16 -r-xr-xr-x 2 root wheel 5248 15 Apr. 03:12 python3.7
34138954 0 lrwxr-xr-x 1 root wheel 17 15 Apr. 03:12 python3.7-config -> python3.7m-config
34138948 16 -r-xr-xr-x 2 root wheel 5248 15 Apr. 03:12 python3.7m
34138949 8 -r-xr-xr-x 1 root wheel 2936 15 Apr. 03:12 python3.7m-config
34127071 16 -r-xr-xr-x 1 root wheel 5216 15 Apr. 10:59 python3.9
34127072 8 -r-xr-xr-x 1 root wheel 3153 15 Apr. 10:59 python3.9-config
cheers
Markus
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
Does anyone know what the * following a filename in macOS terminal means?
All the file names in the folder:
/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands
have a * trailing them and I'm not sure why.
For example:
jd#Mypc % ls -laF
total 1200
drwxr-xr-x 52 root wheel 1664 21 Sep 11:17 ./
drwxr-xr-x 8 root wheel 256 21 Sep 11:17 ../
-rwxr-xr-x 1 root wheel 38896 11 Aug 08:50 appletviewer*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 apt*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:49 extcheck*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 idlj*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jar*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jarsigner*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 java*
-rwxr-xr-x 1 root wheel 48512 11 Aug 08:50 java_home*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 javac*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 javadoc*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 javah*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 javap*
-rwxr-xr-x 1 root wheel 38896 11 Aug 08:50 javapackager*
-rwxr-xr-x 1 root wheel 37952 11 Aug 08:49 javaws*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jcmd*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jconsole*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jcontrol*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jdb*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jdeps*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jhat*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jhsdb*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jimage*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jinfo*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jjs*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jmap*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:49 jmc*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jps*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jrunscript*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jsadebugd*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:49 jshell*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jstack*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jstat*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jstatd*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jvisualvm*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 keytool*
-rwxr-xr-x 1 root wheel 38896 11 Aug 08:50 native2ascii*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 orbd*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 pack200*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 policytool*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:49 rmic*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 rmid*
-rwxr-xr-x 1 root wheel 38896 11 Aug 08:50 rmiregistry*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 schemagen*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 serialver*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 servertool*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 tnameserv*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 unpack200*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 wsgen*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 wsimport*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 xjc*
jd#Mypc %
I'd love to know.
Thanks,
John
They have the trailing asterisk because (a) they're executable; and (b) you supplied the -F option to ls.
See the documentation for the -F option in the man page for ls:
-F Display a slash (`/') immediately after each pathname that is a
directory, an asterisk (`*') after each that is executable, an at
sign (`#') after each symbolic link, an equals sign (`=') after
each socket, a percent sign (`%') after each whiteout, and a ver-
tical bar (`|') after each that is a FIFO.
Those files have their executable bit set, e.g.
$ touch foo
$ ls -laF foo
-rw-r--r-- 1 user staff 0 Sep 27 18:33 foo
$ chmod a+x foo
$ ls -laF foo
-rwxr-xr-x 1 user staff 0 Sep 27 18:33 foo*
As for the executable-looking emulator that you can't actually execute, this can happen when the dynamic loader requested by emulator doesn't exist. You can check what kind of file emulator is with the command file emulator, and check what dynamic loader and libraries it needs with ldd emulator (any line showing “not found” is something you need to install). Given the name of the directory and the size of the file, emulator is probably a Linux x86 binary. I suspect you have an amd64 system. If so, you need to install a runtime environment for 32-bit applications; on Ubuntu, you need the ia32-libs package (and perhaps also ia32-libs-gtk). You could also get this error message for a script whose interpreter as indicated in the #! line doesn't exist.
https://superuser.com/questions/178786/what-does-the-asterisk-mean-after-a-filename-when-you-type-ls-l
same question here.
I am unable to do brew update because I can’t chown /usr/local:
$ brew update
Error: /usr/local is not writable. You should change the ownership
and permissions of /usr/local back to your user account:
sudo chown -R $(whoami) /usr/local
based on this: https://github.com/Homebrew/brew/issues/385
I tried these 2 chown command but it didnt work:
$ sudo chown -R $(whoami) $(brew --prefix)
chown: /usr/local: Operation not permitted
$ sudo chown -R $(whoami) /usr/local
chown: /usr/local: Operation not permitted
Here is my /usr/local listing:
$ cd /usr/local
$ ls -al
total 56
drwxr-xr-x 23 root wheel 736 Dec 2 15:24 .
drwxr-xr-x# 9 root wheel 288 Oct 26 00:22 ..
-rw-r--r-- 1 megasap wheel 0 Dec 2 15:11 .com.apple.installer.keep
drwxr-xr-x 16 megasap admin 512 Jan 11 14:08 .git
drwxr-xr-x 5 megasap admin 160 Dec 2 15:24 .github
-rw-r--r-- 1 megasap admin 1112 Aug 11 2016 .gitignore
-rw-r--r-- 1 megasap admin 253 Aug 11 2016 .travis.yml
-rw-r--r-- 1 megasap admin 291 Aug 11 2016 .yardopts
-rw-r--r-- 1 megasap admin 3161 Aug 11 2016 CODEOFCONDUCT.md
drwxr-xr-x 35 megasap admin 1120 Jan 11 11:35 Cellar
-rw-r--r-- 1 megasap admin 1241 Jan 26 2016 LICENSE.txt
drwxr-xr-x 9 megasap admin 288 Dec 2 15:25 Library
-rw-r--r-- 1 megasap admin 5451 Aug 11 2016 README.md
drwxr-xr-x 262 megasap admin 8384 Jan 11 23:09 bin
drwxr-xr-x 11 megasap admin 352 Dec 2 15:25 etc
drwxr-xr-x 57 megasap staff 1824 Dec 2 15:25 include
drwxr-xr-x 102 megasap staff 3264 Dec 2 15:25 lib
drwx------ 4 megasap wheel 128 Dec 2 15:24 libexec
drwxr-xr-x 3 megasap admin 96 Dec 2 15:23 n
drwxr-xr-x 34 megasap admin 1088 Dec 2 15:25 opt
drwxr-xr-x 8 megasap admin 256 Dec 2 15:24 sbin
drwxr-xr-x 16 megasap admin 512 Dec 2 15:25 share
drwxr-xr-x 8 megasap admin 256 Dec 2 15:25 var
I'm using macOS 10.13.1 high sierra.
Reinstalling Homebrew worked for me
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
You may want to try:
sudo chown -R $(whoami) $(brew --prefix)/*
For more see: https://github.com/Homebrew/brew/issues/3228
Apparently this is due to mac's "system integrity configuration". To get around this you need to reboot your machine into recovery mode (restart your machine and hold down ⌘+R) go into Utilities > Terminal and type the command:
csrutil disable
reboot
And then run your chown command. I guess its recommended to reenable this after changing permissions to re-enable the security.
Full disclosure, I haven't tried this myself - I'll give it a go later today since its a massive PITA. For the record, I'm only attempting to install python3.
Original information
On Mac, I have to give "Full Disk Access" to the terminal using the below page -
https://macreports.com/terminal-says-operation-not-permitted-on-mac-fix/
uninstall and install Homebrew using https://github.com/Homebrew/install
I install lua success in my mac, but i got "-bash: lua: command not found" message when i run lua cmd, but i run /usr/loca/bin/lua success, i confirm the path that lua installed is included in PATH. I record some information as follow:
lxr:bin wang$ pwd
/usr/local/bin
lxr:bin wang$ echo $PATH
.;/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:JAVA_HOME/bin
lxr:bin wang$ lua
-bash: lua: command not found
lxr:bin wang$ pwd
/usr/local/bin
lxr:bin wang$ ls -l
total 872
-rwxr-xr-x 1 root wheel 80 11 23 00:40 VBoxAutostart
-rwxr-xr-x 1 root wheel 82 11 23 00:40 VBoxBalloonCtrl
-rwxr-xr-x 1 root wheel 80 11 23 00:40 VBoxBugReport
-rwxr-xr-x 1 root wheel 77 11 23 00:40 VBoxDTrace
-rwxr-xr-x 1 root wheel 79 11 23 00:40 VBoxHeadless
-rwxr-xr-x 1 root wheel 77 11 23 00:40 VBoxManage
-rwxr-xr-x 1 root wheel 79 11 23 00:40 VBoxVRDP
-rwxr-xr-x 1 root wheel 77 11 23 00:40 VirtualBox
lrwxr-xr-x 1 root wheel 14 3 28 2016 git -> ../git/bin/git
lrwxr-xr-x 1 root wheel 37 3 28 2016 git-credential-osxkeychain -> ../git/bin/git-credential-osxkeychain
lrwxr-xr-x 1 root wheel 24 3 28 2016 git-cvsserver -> ../git/bin/git-cvsserver
lrwxr-xr-x 1 root wheel 20 3 28 2016 git-shell -> ../git/bin/git-shell
lrwxr-xr-x 1 root wheel 26 3 28 2016 git-upload-pack -> ../git/bin/git-upload-pack
lrwxr-xr-x 1 root wheel 15 3 28 2016 gitk -> ../git/bin/gitk
-rwxr-xr-x 1 root wheel 221128 12 1 15:53 lua
-rwxr-xr-x 1 root wheel 150520 12 1 15:53 luac
-rwxr-xr-x 1 root wheel 2670 11 28 2014 pstorm
-rwxr-xr-x 1 root wheel 1394 3 8 2017 ssh-copy-id
-rwxr-xr-x 1 root wheel 75 11 23 00:40 vbox-img
-rwxr-xr-x 1 root wheel 77 11 23 00:40 vboxwebsrv
lxr:bin wang$ ./lua
Lua 5.3.0 Copyright (C) 1994-2015 Lua.org, PUC-Rio
>
lxr:bin wang$
The first two characters in $PATH should probably be .:, not .;.
I found these libraries: http://www.g95.org/downloads.shtml. I downloaded the x86 OSX binaries, unzipped the file, and did ln -s bin/i686-apple-darwin10.3.0-g95 /usr/local/bin/g95, and added chmod +rx permissions to all these files, but I still can't run the g95 executable.
g95-install$ ls -la *
-rwxr-xr-x# 1 kilojoules staff 138126 Jan 17 2013 G95Manual.pdf
-rwxr-xr-x# 1 kilojoules staff 523 Jul 15 22:43 INSTALL
bin:
total 352
drwxr-xr-x# 3 kilojoules staff 102 Jan 17 2013 .
drwxr-xr-x# 6 kilojoules staff 204 Jul 15 22:43 ..
-rwxr-xr-x# 1 kilojoules staff 176968 Jan 17 2013 i686-apple-darwin10.3.0-g95
lib:
total 0
drwxr-xr-x# 3 kilojoules staff 102 Jul 15 22:39 .
drwxr-xr-x# 6 kilojoules staff 204 Jul 15 22:43 ..
drwxr-xr-x# 3 kilojoules staff 102 Jul 15 22:39 gcc-lib
$ ln -s bin/i686-apple-darwin10.3.0-g95 /usr/local/bin/g95
$PATH
-bash: /usr/local/bin:/usr/local/sbin:/Users/kilojoules/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin: No such file or directory
$ g95
-bash: g95: command not found
Why isn't there a brew formula for this?
I have installed the global npm package jslint and it lives here
$ ls -la /usr/local/bin/jslint
lrwxr-xr-x 1 lust admin 40 Feb 12 15:31 /usr/local/bin/jslint -> ../lib/node_modules/jslint/bin/jslint.js
$ ls -la /usr/local/lib/node_modules/jslint/bin
total 8
drwxr-xr-x 3 lust staff 102 Apr 16 2012 .
drwxr-xr-x 10 lust staff 340 Feb 12 15:31 ..
-rwxr-xr-x 1 lust staff 2330 Apr 16 2012 jslint.js
$ which jslint
/usr/local/bin/jslint
$ head -3 /usr/local/bin/jslint
#!/usr/bin/env node
var linter = require("../lib/linter");
So it is without any doubt whatsoever at this point that jslint is in fact being run from this dir and not here:
$ ls -la .npm/jslint/0.1.9/package/bin/
total 8
drwxr-xr-x 3 lust staff 102 Apr 16 2012 .
drwxr-xr-x 9 lust staff 306 Feb 12 15:31 ..
-rwxr-xr-x 1 lust staff 2330 Apr 16 2012 jslint.js
There appear to be two copies of the package, one in /usr/local/ and one in ~/.npm. Why is there one in .npm and is it safe for me to remove it?
~/.npm is a cache that npm uses to avoid re-downloading the same package multiple times. There's no harm in removing it. You can empty it with the command:
npm cache clean