Take it easy, I'm a n00b. I get this error when I'm trying to initialize an environment to get a project going. I've scoured through many stack overflow and GitHub (Usage/request) before I decided to post here. I updated pipenv and even updated by python up to 3.7 from 3.6. I've been at it for 2 hours but I decided I may need your help.   pipenv run python3 Creating a virtualenv for this project… Pipfile: /home/user1/Pipfile Using /usr/bin/python3 (3.6.7) to create virtualenv… ⠙ Creating virtual environment... ✘ Failed creating virtual environment  [pipenv.exceptions.VirtualenvCreationException]:   File "/home/user1/.local/lib/python3.6/site-packages/pipenv/cli/command.py", line 408, in run [pipenv.exceptions.VirtualenvCreationException]:       command=command, args=args, three=state.three, python=state.python, pypi_mirror=state.pypi_mirror [pipenv.exceptions.VirtualenvCreationException]:   File "/home/user1/.local/lib/python3.6/site-packages/pipenv/core.py", line 2310, in do_run [pipenv.exceptions.VirtualenvCreationException]:       three=three, python=python, validate=False, pypi_mirror=pypi_mirror, [pipenv.exceptions.VirtualenvCreationException]:   File "/home/user1/.local/lib/python3.6/site-packages/pipenv/core.py", line 574, in ensure_project [pipenv.exceptions.VirtualenvCreationException]:       pypi_mirror=pypi_mirror, [pipenv.exceptions.VirtualenvCreationException]:   File "/home/user1/.local/lib/python3.6/site-packages/pipenv/core.py", line 506, in ensure_virtualenv [pipenv.exceptions.VirtualenvCreationException]:       python=python, site_packages=site_packages, pypi_mirror=pypi_mirror [pipenv.exceptions.VirtualenvCreationException]:   File "/home/user1/.local/lib/python3.6/site-packages/pipenv/core.py", line 935, in do_create_virtualenv [pipenv.exceptions.VirtualenvCreationException]:       extra=[crayons.blue("{0}".format(c.err)),] [pipenv.exceptions.VirtualenvCreationException]: Traceback (most recent call last):   File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main     "__main__", mod_spec)   File "/usr/lib/python3.6/runpy.py", line 85, in _run_code     exec(code, run_globals)   File "/home/user1/.local/lib/python3.6/site-packages/virtualenv.py", line 26, in &lt;module&gt;     import logging ImportError: bad magic number in 'logging': b'\x03\xf3\r\n' Error in sys.excepthook: Traceback (most recent call last):   File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook     from apport.fileutils import likely_packaged, get_recent_crashes   File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in &lt;module&gt;     from apport.report import Report   File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in &lt;module&gt;     import apport.fileutils   File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in &lt;module&gt;     from apport.packaging_impl import impl as packaging   File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in &lt;module&gt;     import apt   File "/usr/lib/python3/dist-packages/apt/__init__.py", line 26, in &lt;module&gt;     from apt.package import Package   File "/usr/lib/python3/dist-packages/apt/package.py", line 24, in &lt;module&gt;     import logging ImportError: bad magic number in 'logging': b'\x03\xf3\r\n'  Original exception was: Traceback (most recent call last):   File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main     "__main__", mod_spec)   File "/usr/lib/python3.6/runpy.py", line 85, in _run_code     exec(code, run_globals)   File "/home/user1/.local/lib/python3.6/site-packages/virtualenv.py", line 26, in &lt;module&gt;     import logging ImportError: bad magic number in 'logging': b'\x03\xf3\r\n'  Failed to create virtual environ   ment.
What's the "Bad magic number" ImportError in python, and how do I fix it?  The only thing I can find online suggests this is caused by compiling a .py -> .pyc file and then trying to use it with the wrong version of python. In my case, however, the file seems to import fine some times but not others, and I'm not sure why.  The information python's providing in the traceback isn't particularly helpful (which is why I was asking here...), but here it is in case it helps:  Traceback (most recent call last):   File "run.py", line 7, in &lt;module&gt;     from Normalization import Normalizer
Can Windows use a Linux shell instead of cmd? I was wondering if it is somehow technologically possible for Windows to add some sort of Linux interface?  I think it would win over many programmers to develop on Windows.  Any ideas on this? Suppose $G$ is a group and $K\lhd H\lhd G$ are normal subgroups of $G$. Is $K$ a normal subgroup of $G$, i.e. $K\lhd G$? If not, what extra conditions on $G$ or $H$ make this possible?  Applying the definitions, we know $\{ghg^{-1}\mid h\in H\}=H$ and $\{hkh^{-1}\mid k\in K\}=K$, and want $\{gkg^{-1}\mid k\in K\}=K$. Clearly, the best avenue for a counterexample is if $gkg^{-1}\not\in K$ for some $k\in K$ and $g\in G-H$.  If no such element exists, $\{gkg^{-1}\mid k\in K\}\subseteq K$ implies $\{gkg^{-1}\mid k\in K\}=K$ because if $k'\in K$, $gk'g^{-1}=k\in K\Rightarrow k'=g^{-1}kg\in\{gkg^{-1}\mid k\in K\}$. Releasing bound ports on process exit How do I make sure that a socket bound to a port is properly released on process exit such that the port can be reused without bind() failing with EADDRINUSE? I've written a tiny program which just creates a socket, binds it to a fixed port, waits for a connection and then immediately terminates. When I rerun the program, the bind() call fails with EADDRINUSE, but if I wait a few minutes, it succeeds.  Is there a way I can explicitly "unbind" the socket, thereby freeing the port number? Is static HTML the fastest? Attribute field names truncation when creating shapefiles I am wondering what is the expression that truncate a given name to the 10 characters name used in ESRI shapefiles when an object is saved as shapefile with the function writeOGR in R. For example, the attribute field from a spatial dataframe "Ablepharus kitaibelii" is converted to "Ablphrk" when saved as shapefile, how the truncation is done? Give a sequence $(f_n)_{n\in \mathbb{N}}$ of differentiable functions which uniformly converge to $0$, but for which the seqeunce $(f_n')_{n\in \mathbb{N}}$ of the derivatives isn't even pointwise convergent.    I found this one in my textbook marked as "Fun things to solve" and although it may be fun, it's kind of hard to do.   To be honest I already failed at the first hurdle. I couldn't even find a sequence of functions which uniformly converges to $0$.   Is there a certain way of dealing with this kind of problem? Because it seems kind of hard for me to come up with sequences without a mathematical of way of doing so (or maybe there is a mathematical way I just don't know yet). This code always works, even in different browsers:  function fooCheck() {   alert(internalFoo()); // We are using internalFoo() here...    return internalFoo(); // And here, even though it has not been defined...    function internalFoo() { return true; } //...until here! }  fooCheck();   I could not find a single reference to why it should work, though. I first saw this in John Resig's presentation note, but it was only mentioned. There's no explanation there or anywhere for that matter.  Could someone please enlighten me? Installing debian package through Synaptic I want to install a .deb file. After going through various questions, I came across these three options: dpkg, GDebi and Ubuntu Software Center. However, I want to install the. Deb file via Synaptic Package Manager only. Is there any method by which I can install. Deb file as well as all it's dependencies via Synaptic Package Manager? Proving $\mathbb{F}_p/\langle f(x)\rangle$ with $f(x)$ irreducible of degree $n$ is a field with $p^n$ elements I am attempting to prove what the title says, that $\mathbb{F}_p/\langle f(x)\rangle$ with $f(x)$ irreducible of degree $n$ is a field with $p^n$ elements.  I have already proven that for any field $K$ and polynomial $f(x)$ in $K[x]$, $K[x]/\langle f(x)\rangle$ is a field if and only if $f(x)$ is irreducible in $K[x]$. So I know that $\mathbb{F}_p/\langle f(x)\rangle$ is a field for sure. Where I'm lost is figuring out how to know for sure that there are $p^n$ elements. It's fairly clear if $n\in\{ 0 ,1\}$, but I don't think induction is going to help.  I know from a proposition in class that since $F_p = \mathbb{Z}/\langle p\rangle$ and $F_p = \mathbb{Z}/\langle p\rangle$ is an integral domain, $F_p[x] = (\mathbb{Z}/\langle p\rangle)[x] = (\mathbb{Z}[x])/(\langle p\rangle[x])$, but I'm not sure whether or not that's helpful information. Calling Python in PHP I have a Python script I recently wrote that I call using the command line with some options. I now want a very thin web interface to call this script locally on my Mac.  I don't want to go through the minor trouble of installing mod_python or mod_wsgi on my Mac, so I was just going to do a system() or popen() from PHP to call the Python script.  Any better ideas? Thanks in advance! When doing calculations on very large numbers where integral data types such as double or int64 falls short, a separate class to handle such large numbers may be needed.    Does anyone care to offer an efficient algorithm on how best to do this? Often, TeX outputs underfull hbox and vbox warnings when running and in the generated log file. What are these and how can I get rid of them? Half doesn't or half don't? I would like to be able to write a Java class in one package which can access non-public methods of a class in another package without having to make it a subclass of the other class. Is this possible? In the Breusch-Godfrey test we use a model  $$ e_t = \varepsilon_t + \beta_1 \varepsilon_{t-1} + \dots+ \beta_p \varepsilon_{t-p}. $$  If we reject the null hypotesis of no serial auotocorrelation of the error, it means that the residuals follow an auto-regressive model of order ($p$).  If I want to avoid this problem, I must add a certain number of lags of the response variable $y$ as regressors in the original model. However, in some cases this method is not useful.   Are there other options to consider? Which style is preferred? Is there a good reason for one vs. the other?  Thanks in advance!  1) cmds.each do |cmd|    end  2) cmds.each { |cmd|    }   Example code:  cmds = [ "create", "update", "list", "help" ]  # Block style one # cmds.each do |cmd|   puts "loop1, cmd: #{cmd}" end  # Block style two # cmds.each { |cmd|   puts "loop2, cmd: #{cmd}" } How to approach the modeling of duct work, piping, wiring? How do you do a deep copy of an object in .NET? How long should I keep my tax documents, and why? What's the simplest SQL statement that will return the duplicate values for a given column and the count of their occurrences in an Oracle database table?  For example: I have a JOBS table with the column JOB_NUMBER.  How can I find out if I have any duplicate JOB_NUMBERs, and how many times they're duplicated?