Installing PlatformIO - platformio not in path - pip

I know I'm missing something obvious here but...
After following the installation instructions for PlatformIO (using the install script):
$ platformio
gives
command not found: platformio
Same results using pip install platformio (probably what the script uses in the first place, but I thought I'd try anyways)

Please config your CLI tools via this methods:
https://docs.platformio.org/en/latest/installation.html#install-shell-commands
for example:
export PATH=$PATH:~/.platformio/penv/bin
see the link for details

Related

I'm trying to set up the emscripten SDK on Windows 10 but emcc can't be found

On linux there's no problem but I want to compile my code on windows. I follow the instructions exactly. Specifically, I open a command prompt and run the following in the same directory I cloned the emscripten git repo in to.
git pull
emsdk install latest
emsdk activate latest
emsdk_env.bat
There is suspiciously no output and emcc cannot be found. What could I be doing wrong here?
If you go to the command line and type python --version the version of python installed should come up.
If it doesn't, go to the directory in which python is installed and add this to your PATH.
Restart the command prompt and try python --version again. If you get the version of python, follow the steps you mentioned.
You should get some output.
Let me know if the problem still has not been resolved.
You need to install Python 2.7.12 or newer.
https://emscripten.org/docs/getting_started/downloads.html#windows

Mac OSX Terminal not Recognizing installed CLI Tool

I'm trying to literally download and run the ElectronNet demo (found here). I install the CLI tool, which appears to be accomplished successfully, but when I try to use the tool, terminal does not recognize it. Shown below:
% dotnet tool install electronnet.cli -g
Tool 'electronnet.cli' is already installed.
%electronize start
zsh: command not found: electronize
What could be going on here?
I guess it's something with your path&zsh,
if you try:
~/.dotnet/tools/electronize start
is that work for you?
If so, you can fix your path by editing ~/.zshrc, add this:
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet/bin"
and source the file by running: ". ~/.zshrc"

Installation of Xdebug on MacOS Catalina 10.15

I tried to install Xdebug on OS X 10.15 and run into following problem:
/private/tmp/pear/install/xdebug/xdebug.c:25:10: fatal error: 'php.h' file not found
I tried to fix the problem like described here: Installing xdebug on MacOs Mojave - 'php.h' file not found
Unfortunately the header files cannot be found in this directory: /Library/Developer/CommandLineTools/Packages
Any ideas where I can get the current header files for OS X 10.15?
Update
For anyone that just want xdebug support on MacOS, most of the instructions in this answer are not necessary when using the built-in version of PHP. Before doing anything, you should check if xdebug.so already exists in /usr/lib/php/extensions/no-debug-non-zts-20180731/, which should be there by default. If so, you can skip to the Enabled support in PHP portion of this answer.
Using Homebrew is also an acceptable solution for you (and can also prevent other issues).
For anyone else looking to actually build binaries on MacOS and get the header error, the full answer is for you. It also answer OP question directly. Note building xdebug from source code and actually trying to use that version of xdebug.so with the build-in PHP should end up in a "code signature" error. As described here and here, the only real solution would be to compile and use you own instance of PHP instead of the built-in one. In any situation, using Homebrew would be easier.
tl;dr
Apple decided to remove headers file in /usr/include and the macOS_SDK_headers_for_macOS_10.14.pkg package. To install Xdebug, you'll have to manually compile Xdebug with the correct reference in both phpize and make.
For more details, I wrote a blog article about the issue and the solution
Original Answer:
Long story short, Apple decided to nuke /usr/include in MacOS Catalina, which has been the default location for C header file for ever in UNIX systems. Trying to install through PEAR / PECL will return an error as the compiler will look for necessary headers file in /usr/include. So the solution is to compile Xdebug manually, manually specifying the actual location of the header files, which are still provided by Xcode, just at a different location.
First, make sure Xcode is installed, including the command line tools. The following command will display the location of the default SDK :
$ xcrun --show-sdk-path
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
The header you'll want (php.h) will then be in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/php/main.
Getting source
Let's compile 2.7.2, getting the source code from git. Alternatively, you can download the source from Xdebug site.
git clone https://github.com/xdebug/xdebug.git
cd xdebug
git checkout tags/2.7.2
phpize
Next we need to make a copy phpize so we can edit the include path :
cp /usr/bin/phpize .
nano ./phpize
Find this line :
includedir="`eval echo ${prefix}/include`/php"
...and replace it with this line :
includedir="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/php"
Run phpize:
./phpize
You should now see something like this :
Configuring for:
PHP Api Version: 20180731
Zend Module Api No: 20180731
Zend Extension Api No: 320180731
Configure & build
We can now configure :
./configure --enable-xdebug
...and run make using our custom SDK location defined as compiler flags :
make CPPFLAGS='-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/php -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/php/main -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/php/TSRM -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/php/Zend -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/php/ext -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/php/ext/date/lib'
Might see some warning, just ignore it for now. Finally, we'll need to run :
make install
Again, this command will fail because it can't move the extension to the right place. SIP will prevent it. But no worries, we'll take care of that manually at the next step. make install is still required as it will sign the *.so file.
Enabled support in PHP
Next, we move the executable somewhere safe. I use /usr/local/php/extensions.
sudo mkdir -p /usr/local/php/extensions
sudo cp /usr/lib/php/extensions/no-debug-non-zts-20180731/xdebug.so /usr/local/php/extensions
Then we edit the PHP configuration to enable Xdebug. Simply edit php.ini:
sudo nano /etc/php.ini
And we add the following at the bottom :
[xdebug]
zend_extension=/usr/local/php/extensions/xdebug.so
xdebug.remote_enable=on
xdebug.remote_log="/var/log/xdebug.log"
xdebug.remote_host=localhost
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
Restart built in server to be sure :
sudo apachectl restart
And finally test everything went fine :
php -i | grep "xdebug support"
If the above command returns nothing, then Xdebug is not available on your install. Go back the steps to find out what's missing.
Note:
A more complete fix would be to edit the result of php-config --include-dir, which returns /usr/include/php. That would make any installation find the necessary header files without having to manually edit files or compiler flags.
If you are using brew, I solve this by reinstalling php and re-linking:
brew reinstall php#7.3
brew link --overwrite php
I got an error when I tried to install xdebug in MacOS Catalina 10.15:
pecl install xdebug-3.0.1
Error:
/private/tmp/pear/install/xdebug/xdebug.c:25:10: fatal error: 'php.h' file not found
This is due to Apple decided to remove headers file in /usr/include, like you can see in other answer.
Then I added config to .bash_profile, executing these lines in console:
echo 'export PATH="/usr/local/opt/php#7.3/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/php#7.3/sbin:$PATH"' >> ~/.bash_profile
export LDFLAGS="-L/usr/local/opt/php#7.3/lib"
export CPPFLAGS="-I/usr/local/opt/php#7.3/include"
source ~/.bash_profile
After that you can try to install xdebug again with pecl:
pecl install xdebug-3.0.1
Notes: Previously I have installed PHP 7.3 with "brew". You should adjust the php and xdebug version, in the above lines, adding the versions that you prefer.
I would recommend you use "brew" to install PHP, and then use the "pecl" tool that comes with the installed version of brew's PHP to install Xdebug.
you can find detailed instructions with ready to use patches on this site: https://profilingviewer.com/installing-xdebug-on-catalina.html

-bash: scala: command not found

I'm trying to install scala on my mac (Maverick).
I downloaded and unarchived it.
I then put myself from where it was unarchived and inside the /bin folder in the terminal.
But when I run "scala" or "scalac" I get :
-bash: scala: command not found
Why?
I always suggest that mac users install homebrew and use homebrew as their primary package installer to install software.
Installing scala is as simple as
brew install scala
Homebrew will also install/fix java dependencies for you and handle path issues (I believe)
I get the same issue and quickly I found everything is fine, if you write the correct path into your .bash_profile.
The only thing you need is to close current terminal and open a new one, on which Scala would work.
Hope this work for you.
do you have Java installed and available on your PATH http://sourabhbajaj.com/mac-setup/Java/README.html the same author also provides good Scala / SBT setup info http://sourabhbajaj.com/mac-setup/Java/README.html

Using Google App Engine SDK with Python 2.7 on Mac OS X 10.6

I need to run Python 2.7 on my Mac Snow Leopard, which has Python 2.6 installed. According to this answer, running the Python 2.7 mpkg installer from Python.org should get me there.
The reason I need to do this is that I'm trying to run the Google App Engine SDK for the Python 2.7 runtime.
After installing Python 2.7, I'm still getting the following warning in my GAE server log:
Warning: You are using a Python runtime (2.6) that is older than the
production runtime environment (2.7).
What else must I do to get the GAE SDK to recognize the new Python version?
EDIT 2:
Running:
$ sudo find / -name python2.7
I get:
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/usr/local/bin/python2.7
According to the answers I went into GoogleAppLauncher -> Preferences and set the Python path to each of these, and each time I get the exact same error.
Running dev_appserver with the following flags:
--admin_console_server= --port=8081 Python command: /Library/Frameworks/Python.framework/Versions/2.7 2011-11-14
16:12:24.726 GoogleAppEngineLauncher[57590:203] *** NSTask: Task
create for path '/Library/Frameworks/Python.framework/Versions/2.7'
failed: 22, "Invalid argument". Terminating temporary process.
Another Wierd thing is, it always tries to resolve to the same path, no matter which of those I plug in; It always reverts to /Library/Frameworks/Python.framework/Versions/2.7
EDIT 3:
OK, after entering the paths into the prefs field repeatedly, I finally just cleared it out, and somehow it's now pointing to the right place:
Running dev_appserver with the following flags:
--admin_console_server= --port=8081
Python command: /usr/local/bin/python2.7
Open the GAE launcher preferences and set the Python Path option to the fresh installed Python 2.7, in your case /usr/local/bin/python2.7 .
Came across this question looking for a solution to the same dilemma regarding Mac, GAE and Python.
One comment I would like to make regarding setting the Python path using GAE Preferences. I notice you mention that you had a problem setting the Python path using the Preferences. I discovered that after editing the path, you have to press Enter. Otherwise, the path doesn't get updated. This might explain the weirdness you were mentioning when trying to edit the path field.
I installed python 2.7.x from macports. I see this:
$ python --version
Python 2.7.2
$ which python
/opt/local/bin/python
So, in the preferences for GoogleAppEngineLauncher.app I set the python path to:
/opt/local/bin/python
In the console log, I see this:
*** Running dev_appserver with the following flags:
--admin_console_server= --port=8081
Python command: /opt/local/bin/python
I still see some errors about libraries, in particular Can't open zipfile...setuptools but simple stuff at least seems to work.
Good luck!
I am not sure if it helps, but instead of using the binaries from Python, I used MacPorts http://www.macports.org/ and installed the Python 2.7 runtime:
sudo port install python27

Resources