Leiningen cannot find SDK - clojure

I'm trying to install Leiningen from here https://djpowell.github.io/leiningen-win-installer/. But it cannot find SDK. If I check "Custom path" then it gives an out of range error on the next screen. Both Java and SDK are installed.

that installer automates these steps (from the project page)
The installer makes curl.exe available so that leiningen can download and upgrade files.
The installer downloads and installs the latest lein.bat from github.
lein.bat is added to your PATH variable.
LEIN_JAVA_CMD is set to point to your selected JDK, and the :java-cmd property is set in your user profile in profiles.clj.
lein self-install is run to install the Leiningen JAR file.
The uninstaller will remove the files that were installed, together with the Leiningen self-installs and search indexes; the environment variables that were set, and the additions to the PATH.
A likely area for this to do wrong is the setting of LEIN_JAVA_CMD and the :java-cmd key in the leiningen profile.clj file.
I'd first check:
the java path is correct in the value of the LEIN_JAVA_CMD environment vatiable
check the profiles.clj file in your home dirctory for conflicting JRE paths
uninstall that installer and do it by following the instructions at https://leiningen.org/
also note that Clojure only required the java runtime JRE and does not require or use the JDK. differing versions and paths between these has caused problems as well.

Related

Unable to install arcpy module using Pycharm

I realize this has come up before, but all the responses I've found were for different versions of Arc.
I have followed the steps from this link and set my project interpreter to python c:\Python27\ArcGIS10.4\python.exe. Based from what i've read, that should be set up with Arcpy pre-installed. However, if I look at the packages in the VENV, arcpy isn't listed. I've tried adding it using pip and the pycharm GUI package manager. There isn't a package just named arcpy, the options are:
arcpy-metadata
arcpy-virtualenv
arcpyext
arcpylogger
I have successfully installed all of them and they show up in the package list of the project virtual environment. Despite this, I still get "no module named arcpy" as an error when I go to run a script.
Any ideas about where i'm going wrong?
Thanks for your help.
So I've spent a while looking over the issue and using Conda as your project Interpreter is the fix to your issue. I've tested it myself as well. Here are some clear instructions on how to correctly install Conda and set up the environment in Pycharm:
To create a Conda environment:
Ensure that Anaconda or Miniconda is downloaded and installed on your computer, and you're aware of a path to its executable file.
(Refer to the installation instructions for more details.)
Press Meta+Comma to open the project Settings/Preferences.
In the Settings/Preferences dialog Meta+Comma, select Project | Project Interpreter. Click the The Configure project interpreter icon and select Add.
In the left-hand pane of the Add Python Interpreter dialog, select Conda Environment.
The following actions depend on whether the Conda environment existed before.
If New environment is selected:
Specify the location of the new Conda environment in the text field, or click Conda environment location and find location in your file system. Note that the directory where the new Conda environment should be located, must be empty!
Select the Python version from the list.
Specify the location of the Conda executable file in the text field, or click Conda executable location and find location in the Conda installation directory. You're basically looking for a path that you've used when installing Conda on your machine.
Select the Make available to all projects checkbox, if needed.
If Existing environment is selected:
Expand the Interpreter list and select any of the existing interpreters. Alternatively, click Select an interpreter and specify a path to the Conda executable in your file system, for example, C:\Users\jetbrains\Anaconda3\python.exe.
Select the checkbox Make available to all projects, if needed.
Click OK to complete the task.

Google Cloud SDK installation fails on Windows 10

When I tried to install Google Cloud SDK, it fails:
Welcome to the Google Cloud SDK!
To use the Google Cloud SDK, you must have Python installed and on your PATH.
As an alternative, you may also set the CLOUDSDK_PYTHON environment variable
to the location of your Python executable.
Google Cloud SDK installer will now exit.
Press any key to continue . . .
I installed Python and copied system32 path in system variable and environment variable even, but still fails. What's going wrong?
I had the same problem some time ago, this is how I solved it:
uninstall cloud sdk (delete also the folder), uninstall python
reboot you system
launch the installer and select "install bundled python"
when the installer asks for an installation path, point to "C:\Users\YOUR_USER\AppData\Roaming\gcloud"
I had a problem with my windows installation since I had different permissions set on the default path suggested which was "Program Files (x86)".
Starting fresh + changing path fixed the issue for me :)
also review this page, to see if everything is in check for you

Installing Python 2.7.16 and packages offline. Concerns with dependencies

Problem
I am attempting to install Python 2.7.16, openpyxl, and pyinstaller onto a Windows 10 machine that is offline for security reasons. To clarify, I have a mapped network drive on there from which I can transfer the files I need to use.
Question
What is the best way to go about this? I currently have a .msi Python installation file directly from their website. The packages I need are packaged as .tar.gz files. I currently have those on my windows machine, but do not want to proceed until I know for sure what I need to do. Also, do I need to do anything for dependencies? If so, how do I find the dependencies for the packages I need?
Side Notes
The version of Python (2.7.16) comes with pip. Not sure if that makes a difference. Downloading and transferring things requires me to ask my admin, for him to download the files, and then transfer them to my drive so I can have them on my computer. If able, I would like to do this in as little attempts as possible.
Useful links
Python: https://www.python.org/downloads/release/python-2716/
openpyxl: https://pypi.org/project/openpyxl/#files
pyinstaller: https://pypi.org/project/PyInstaller/#files
My solution would be to seek out the offline versions of the python and pip installer and follow this guide
Also a great tip: try the complete procedure (the installing of the required software) on a seperate pc which you have disconnected and do the installation. Note everything you have to do to get it working and use those instruction on your originally intended machine. This will prevent you from having to go back and forth and scratch your head while installing on the target machine.
Please note that I have NO idea how python works and this is just a hunch from me as a programmer.
Installing Python and packages on an Offline Machine: A Comprehensive Guide
The Environment
Let us begin by defining the environment in which this guide may be of some great use. If your situation can be described by one or more of the following, you might have great results following this guide...
The machine you are developing on is offline. (No connection to the internet)
You need to develop and run Python on the machine that is completely offline.
If this sounds like you, read the following cases in which a few minor details may make a big difference in getting you started.
Case1:
You are not allowed to plug in any external media devices into the offline machine. This includes but is not limited to a USB, CD, floppy disk, or any other removable media that may be of some use in helping you transfer Python files to the offline machine.
You are allowed to map a network drive (somewhere else on the local network). This would fix the problem mentioned in number one with removable media.
Answer: In this case, just proceed with the guide, as this was my case and I will explain in detail how I solved my problem.
Case2:
There is no physical way to transfer files onto the development machine that is offline.
Answer: If this is your case, you need to get in touch with the admin team who handles the software on your development machine. Direct them to this guide to proceed.
Let's Get Started
Warning A:
The following must be performed on a computer with an internet connection. It is impossible to download things from any website without an internet connection.
Warning B:
There is a longer way, and there is a shorter way to do the following. To avoid the longer way, you must be able to install python on a different machine that is online. This can be the same machine that you are using to download the packages and python version, or it can even be a home machine. This can be any machine in the world that is on the internet. It's sole purpose will be to help you identify the dependencies of each package.
Installing Python
Visit the python website and identify the version you want. 2.7.9 and up is recommended for this guide. Download the file for your specific system.
Python 2.7.9 : https://www.python.org/downloads/release/python-279/
Python 3.7.3 : https://www.python.org/downloads/release/python-373/
The reason I provided Python 2.7.9 is because that is the earliest 2.7.x version that comes with pip (a package manager).
Visit the python package index to locate the packages you will be using in your python project. https://pypi.org/
Search the package you need, go to the downloads, and get the (.tar.gz) file. Not the .whl files unless you know what you are doing with those.
Tip: If you want to keep track of the packages you are installing, I suggest you put them all in one folder somewhere you can find, or just write them down on paper.
Unpack the .tar.gz package files. You can get rid of the .tar.gz once you unpack them as they will not needed any longer.
Install the version of python that you downloaded for your system in step 1 above.
(This may just be running the .msi file for windows or unpacking some files for linux) If you are not sure how, just look at this brilliant guide
https://realpython.com/installing-python/
Now you should be able to go to your terminal and type "python" and get the python interpreter to open up. If you get a "cannot find python command" you need to setup your path variable.
Windows guide: https://geek-university.com/python/add-python-to-the-windows-path/
Linux guide: https://www.tutorialspoint.com/python/python_environment.htm
Your python installation is done! And your packages should also be ready to install!
Installing Python Packages
What you need to know here is that MOST all python packages have dependencies, which are other packages which packages need installed before they can be installed. If you need more explanation on dependencies, read here: https://www.fullstackpython.com/application-dependencies.html
Before proceeding be sure to add the Python/Scripts folder to your path variable too or pip will not work. Follow this link for instructions. https://appuals.com/fix-pip-is-not-recognized-as-an-internal-or-external-command/
Install packages using pip install [package_name] for every package you need, on your machine that is on the internet, and then do a pip freeze to see all the packages installed.
Once you can see all the packages installed, which will include the dependencies for the ones you ran pip install on, you need to manually download these dependencies from the python package index https://pypi.org/ just like you did with the regular packages.
Moving Offline
Once you have identified all the packages you will need, and all of their dependencies, you will need to download them, unpack all of them, and move them into one folder, which I will call "OFFLINE_SETUP_FOLDER".
To be clear:
The packages we installed before was only to find out the dependencies we were going to need. You do not have to re-download the packages you have already downloaded before running pip install. You should only need to download the dependencies you have found during the pip freeze command.
Finally you need to copy into the "OFFLINE_SETUP_FOLDER" your python installation file, be it a .msi file for windows, or the .tar file for linux.
Your "OFFLINE_SETUP_FOLDER" should contain the following...
In the following, package can be the name of any package that you downloaded, and the a and b inpackage1a and package1b just represent dependencies for that package. These file names are just examples for packages
python.msi (installation file for python)
/package1 (normal package folder)
/package1a (package dependency folder)
/package1b (package dependency folder)
/package2 (normal package folder)
/package3 (normal package folder)
/package3a (package dependency folder)
Once this is complete, you need to move that folder onto the machine that is completely offline form the network.
Then run the installation for python as you did before and install it on the machine. Do no forget to setup the path variable. Refer back to the Installing Python section if needed.
Open your terminal or CMD and CD into the "OFFLINE_SETUP_FOLDER".
Now you need to CD into each individual package folder, and run this command: python setup.py install and let it run.
If the package install fails, it will be because one of the dependencies has not been installed. If this is the case, CD into the dependency that is says is missing, and run python setup.py install in there first.
Keep repeating these steps until all packages and dependencies have been installed.
This is the end of this python guide for installing python on an offline machine. I hope this helped :)

Server can't find packages after upgrade

Private nuget server can't find packages after upgrade
I had to update the nuget server to get it to accept packages that were failing to upload (apparently the package format changed in dotnet core or something). Now all the previously uploaded packages aren't showing up in nuget. I can see all of them on the server just sitting there in their directories. But they can't be found. New packages are ending up in the server's package directory rather than their own directories.
From prior experience I don't think just copying the packages into the packages directory is going to work.
Trying to actually upgrade the NuGet.Server package from v2.8.6 to v3.0.2 appears to work but in the end the package is still at v2.8.6.
Don't try to upgrade nuget.server projects. That way lies madness.
Carry out the instructions like making a new one.
1) Create a new empty Web Project; target framework is NET Framework 4.6
2) Add NuGet.Server version 3.0.2
3) Fix duplicate <compilation> tag in web.config
4) Apply your API key to web.config and any other nuget configurations you have.
5) Remove old project from installation directory; leaving behind only the Packages directory and optionally any static files you uploaded to the installation directory itself (I keep a copy of nuget.exe and local project icons there).
6) Copy build output of new project to web installation directory.
It starts working. I don't know what's up with upgrading but it ends up with a smashed web.config and who knows what else.

How does one start programming with Clojure in Windows?

I know it is possible to use CounterClockwise inside Eclipse, but I have been trying to get Leiningen to work so that I could use ClojureScript.
I downloaded leiningen using git clone. It then says run the script. I have tried lein self-install from inside PowerShell and inside the git bash environment.
In each I get an error about failing to download leiningen (which I thought I had with the git clone? hmm). It is interesting because one reads instructions that include things that don't make sense to Windows.
For example, inside Powershell, Windows doesn't understand export HTTP_CLIENT. It was only inside the git bash that I got a message that it is possible my HTTP client's certificate store does not have the correct certificate authority.
It then suggests this command, which runs ok, export HTTP_CLIENT="curl --insecure -f -L -o"
but it doesn't fix the problem.
The most recommended method AFAIK is to download the script lein.bat and putting it on the PATH environment variable. I've tested this method on several systems (XP, Windows 7). There is no need to build leiningen from a git checkout yourself. If you have a Windows with Powershell installed lein self-install should download the core .jar file inside a directory .lein in your user directory. Else, make sure you install either wget.exe or curl.exe and put it on the PATH.
There is an installer for Leiningen on Windows. You just need to install Java SE 7 JDK and Leiningen for Windows. This page has detailed instructions with screen shots: http://leiningen-win-installer.djpowell.net/
Leiningen for Windows creates a PATH variable and Clojure REPL shortcut among other things. From the REPL you can create, build, and automate your Clojure project.