MikTex in spyder - anaconda

How do you get LaTex output on Spyder? I saw some other post recommending installing the MikTex package but I don't know how to use it.
I installed the MikTex package on Anaconda Spyder, but now how do I use it? I have:
import sympy as sp
sp.init_printing()
x = sp.symbols('x')
integrate(x)
But nothing

I had troubles getting Latex output to work in Spyder too, and I was able to hunt the bug down. At least for me, the Miktex installation delivered by the conda miktex package got confused about being a shared or a single-user installation, and consequently failed to install the necessary packages on-the-fly.
Here's my strategy:
Verify if you have the same problem by looking at the Miktex log files (on Windows, in your user's AppData\Local\Miktex\2.9\miktex\log directory); watch out for lines like
installing package (...) triggered by (...), immediately followed by entries marked FATAL with the error message Administrative mode cannot be enabled (makes no sense) because this is not a shared MiKTeX setup.
If this is the same issue for you, start the Miktex console in the conda Miktex package; the location is (Anaconda dir)\Library\miktex\texmfs\install\miktex\bin\miktex-console.exe. (Trying to run the _admin version fails with a similar "Administrative mode" error message.)
In the console, go to "Packages", and manuall install the following packages: standalone, varwidth and zhmetrics
After these steps, Latex output worked for me. Note that these package installations are user-specific, so you'll have to repeat them for each user.

Related

Miktex package does not succeed: miktex-fc-cache.exe

I reinstalled miktex multiple times now, but I still get the same error, when updating or installing new packages: The executed process did not succeed (fileName="[path to miktex 2.9 directory]\miktex\bin\x64\miktex-fc-cache.exe", exitCode="1").
I installed it only for my user and let it update packages on the fly.
I already checked, whether the path name contains any unusual symbols or spaces, but the only instance of a space is the very own directory "MiKTeX 2.9".
Unfortunately I don't know how to interpret the miktex report, so I can't find the error myself.
I also tried installing TeXLive but had the same problem, that it could not install any packages.

How to solve "VisibleDeprecationWarning: zmq.eventloop.minitornado is deprecated"?

When I use iPython to run some scripts, I've got the following warning message in iTerm:
/Users/###/anaconda3/lib/python3.6/site-packages/ipykernel/displayhook.py:12:
VisibleDeprecationWarning: zmq.eventloop.minitornado is deprecated in pyzmq 14.0 and will be removed.
Install tornado itself to use zmq with the tornado IOLoop.
When I try to run my code in Visual Studio Code, I've got the following error message:
Error message in VSCode
I have already tried to update Anaconda, I have already tried to install nomkl with conda as well, without any success.
iTerm and VisualStudio on Mac OS 10.14.6, Anaconda up to date (4.7.12)
Remedy Option A)
Use anaconda-tools to separate an environment, say aLastWorkingENV, where you make use of anaconda-tooling to roll-back all components to a last working state, which does not whine about future deprecations. In such aLastWorkingENV environment, all thus synchronised programs will work smooth (as they did before a first component update, that has moved the stick)
Remedy Option B)
Use anaconda-tools to update all current components and all their supporting modules and all packages versions [ python, ipython, pyzmq, jupyter, ..., ] to their most recent versions, where products QA coverage ought either confirm the PASS, or provide a remedy or workaround or the last-trouble-free version ( to eventually downgrade one such package, based on such exception, if present and relevant )
Either way, your code would stop throwing the soft-warnings and remain in such state, until any un-coordinated package update takes place.

Biopython, import error with "import Bio"

I have installed Biopython by Anaconda on Windows.
When I try import Bio I get this error:
ModuleNotFoundError: No module named 'Bio'
Why?
Simone.. it looks like your installation did go wrong somehow. Regardless of why and how try the following stepwise approach to see if your import error remains.
On Windows (the dots denote your installed program path specifics):
e.g. go to: C:\....\Anaconda...\Lib\site-packages
find and remove folders using delete.
folder 1: "\Bio"
folder 2: "\biopython-1.70.dist-info"
The version value 1.70 might be 1.69 when using conda for installation.
Empty your trashbin. This way the system can't do tricks and recover or link to deleted files and folders.
Install pip if its not and grab it from here.
try pip install biopython --no-cache-dir
Voila! Hope it works now for you too... Enjoy!
In case its not check windows environment variables\path.. via control panel>advanced system settings to include PATH to site-packages. Or do similar on other OS.

jython 2.7 package installation

Jython Package installation issue, using pip
Hi, I have installed Jython2.7 configured with pydev in eclipse neon, also configured python 3.6 package
I am able to install packages for python using pip installer?
pip install "packagename"
Below are some of the packages in python/Lib/Site-packages directory
I was able to install all the packages
How do I use pip installer to install packages for jython?
I tried to install Jip package with
jython install setup.py
The binary File got installed in the Jython/Lib/Site-packages folder
However, I am not able to use it.
where and how do I get Jython package binaries like jip?
Also, Please let me know how to search jython packages?
Also, How to make pip install library packages in jython?
Any other configuration like jython home, etc that should be made?
This answer is going to be really generic but I just recently have slogged my way through the setup for jython/jip/pip and here's roughly what I had to do.
Firstly, I'm running Windows 7 64 Bit from behind a proxy (work machine.)
Had to install jython 2.7.0 instead of 2.7.1 because (I think anyway) 2.7.1 requires admin privileges which I don't have on my work PC.
Pip didn't install correctly during the Jython installation and I spent an obscene amount of time trying to get it installed and functioning as I knew it from my cpython days. NOTE: Just because you get pip installed, doesn't mean you can use any package on a python package repo. As of 2.7.0, Jython doesn't have end to end capability to interpret/compile some libraries that rely on certain python wrappers of native OS function calls. I believe 2.7.1 makes solid progress in the direction of supporting all needed native calls but don't quote me on that. For example, I tried to use wxPython to make a simple GUI to test my jython install. Trying to install it from pip kept causing really non-specific error info that took me a lot of time to figure out that the cause was jython simply couldn't compile the wxPython source so beware.
I had to set environment variables 'http_proxy' and 'https_proxy' in the form of http://proxyhosturl:port and https://proxyhosturl:port respectively to get out from behind the proxies without having to invoke pip with the proxy switch every time I called it.
To actually install pip, have a look here. These instructions are for Python and Linux/Unix but the principle is roughly the same. Just use jython -m instead of python -m and ignore the '$' at the start of each command line.
Also be sure to CD to your python_home/bin folder when invoking the ez_install exe.
If that doesn't work (didn't for me), try using get-pip.py script with these instructions https://pip.pypa.io/en/stable/installing/ (remember jython instead of python etc.). Download it, cd to the download location and follow the noted install steps. Worth noting is about half way down the install instructions where it details installing from local archives (source/binary zip or tar.gz archives of pip and setuptools as better described here: https://packaging.python.org/tutorials/installing-packages/#installing-from-local-archives).
The links to the bin archives of pip and setuptools are here:
https://pypi.python.org/pypi/setuptools
https://pypi.python.org/pypi/pip
It may also be worth making sure that your PATH environment variable has the jython/bin path in the variable value. The jython installer should do this but, again, mine did not.
If all goes well, you should be able to invoke pip with the --version switch and if it prints a line with the installed pip version info then you should be good to go
Another quirky issue I had was I could invoke a function of pip one time and any subsequent times I would get a stack trace ending with something along the lines of an object not having a certain property. I fixed that by finding my temp directory by opening a windows explorer instance and typing %TEMP% in the address bar and hitting enter, it should take you to a subdir of your AppData folder and there you may see a folder with the name of the package you were trying to install and the text "_pip" somewhere in the directory name. Delete the directory and try the pip install command again. I had to do this + invoke pip install pip -U to update my install to the latest version. Then pip began behaving correctly in my instance.
pip search numpy (or your library name) will generate a list of results with the same logic it uses to locate your desired package when you call pip install but, again, just because it returns a matching package doesn't mean it will compile when you install it (numpy doesn't work because of the missing java to C native function calls I described earlier.) The trade off is that you can import code artifacts from Java JAR files in your Jython script files and leverage their functionality with relative ease. Between the public Java APIs available and the python packages that work with the jython interpretor, you can (in my experience) come up with a way to accomplish your task. See the following info on JIP, Maven and IDEs.
IDE and jython integration (Eclipse)
- If you are stuck using Eclipse (like me) it actually has pretty decent support for python development. Install the PyDev plugin for Eclipse from Help -> Install Software. Put in this URL https://marketplace.eclipse.org/content/pydev-python-ide-eclipse, hit tab, and select the PyDev plugin and hit 'finish.'
- Setup the jython interpretor info from Windows -> Preferences -> PyDev. Provide the path to your jython.jar file.
- You should now be able to use File -> New PyDev project to create a basic python project and configure it to use your version of Jython and Java.
Brief Overview of Jip and Maven
- jip is a jython package that is invoked very similarly to pip but instead will download JAR files from the Maven Central Repository instead of python packages from pypi.com, for example. See the install instructions described here. Note the install procedure for a global jip install which differ from just pip install jip. https://pypi.python.org/pypi/jip/
- I never got jip to work exactly as I wished because there's not a ton of documentation on it outside of what I already linked. However, if you install a JAR using jip, you have to go to your project in Eclipse and actually add the JARs themselves to your PYTHONPATH in order for import statements and editing to have intellisense and so that you don't get a classnotfound exception at runtime. See following screen shot.
- There is a JIP config file that you can use similar to the pip config ini file but I have yet to find any exhaustive documentation on it's setup.
Note in the above screen shot the first entry in the External libraries entries. By default, pip places installed packages in that directory so to enable eclipse to find them, you need to also ensure that location is entered.
In Conclusion
- I have more to add to this answer and I will do so as soon as possible. In the meantime, see this example project I've loaded into github.
https://github.com/jheidlage1222/jython_java_integration_example
It shows basic config and how to interface with JARs from python code. I used the apache httpcomponents library as an example. Good luck amigo.

How do I install Pyramid on Python 3.3 Windows 7 x64

I have been having a heck of a time trying to install Pyramid on my Python 3.3 Windows 7 x64 machine. I have done the following from scratch with no luck. I have double checked all of my install files:
Install python 3.3
Install Python for Windows extensions
Install Distribute 0.6.34 (latest)
easy_install Virtualenv
Activated my new virtualenv
easy_install pyramid
I followed Pyramid's install guide here while substituting Python32 for Python33:
easy_install pyramid finishes and puts the following egg files in my venv\liv\site-packages folder:
mako-0.7.3-py3.3.egg
pastedeploy-1.5.0-py3.3.egg
pyramid-1.4-py3.3.egg
repoze.lru-0.6-py3.3.egg
translationstring-1.1-py3.3.egg
venusian-1.0a7-py3.3.egg
webob-1.2.3-py3.3.egg
zope.deprecation-4.0.2-py3.3.egg
zope.interface-4.0.3-py3.3-win-amd64.egg
However the actual folders are still in the egg folders and not have been copied to the site-packages folder. Should they be? Seems like an incomplete installation to me because the code can't even see the import modules from those egg folders.
I try to run this test code and I get import errors.
As a test, I moved all the folders in the egg folders up one level so they are now in the site-packages folder. I run the test code and I get different import errors. In fact, I have done this whole install process at least 10 times today from scratch. The import errors can be different. It's almost like the pyramid install is getting corrupted or incomplete. However, the install always finishes with no errors.
Any ideas what is going on?
I've used pip for python and everything went fine, all dependencies were installed and
import pyramid
did not throw any error afterwards.
Have a look at http://pastebin.com/bdv1SK7k.
Note: to install pip you need to, ironically, call easy_install pip

Resources